uk.ac.bham.gloss
Interface Logger

All Known Implementing Classes:
DoubleLogger, MCBLogger, NullLogger

public interface Logger

A Logger object presents a "trace" of an execution, eg, for debugging. All methods here have a version with a "mask" and one without. The masked version checks that the mode agrees with the mask (mode & mask != 0) and then runs the other operation. Otherwise it does nothing and returns a null logger object. The non-mask version performs the operation if the last given mask agrees. See also the class NullLogger, where many of these methods are defined: applications typically subclass NullLogger rather than implementing this interface directly. Copyright Richard Kaye 2007-8 for GLOSS, http://gloss.bham.ac.uk Usage permitted according to the GPL. No waranty.


Field Summary
static int LOG_ACTIONS
           
static int LOG_ALL
           
static int LOG_ERRORS
           
static int LOG_FILES
           
static int LOG_INPUT
           
static int LOG_MESSAGES
           
static int LOG_MODES
           
static int LOG_NONE
           
static int LOG_NORMAL
           
static int LOG_OUTPUT
           
static int LOG_PARAMETERS
           
static int LOG_PROCESSES
           
 
Method Summary
 Logger attribute(int mask, java.lang.String name, boolean value)
          add attribute to an opened tag
 Logger attribute(int mask, java.lang.String name, int value)
          add attribute to an opened tag
 Logger attribute(int mask, java.lang.String name, java.lang.String value)
          add attribute to an opened tag
 Logger attribute(java.lang.String name, boolean value)
          add attribute to an opened tag
 Logger attribute(java.lang.String name, int value)
          add attribute to an opened tag
 Logger attribute(java.lang.String name, java.lang.String value)
          add attribute to an opened tag
 Logger closeelement()
          closes the element line
 Logger closeelement(int mask)
          closes the element line
 Logger closeelement(int mask, java.lang.String name)
          closes the element line, checking correct name
 Logger closeelement(java.lang.String name)
          closes the element line, checking correct name
 Logger closetag()
          close the tag
 Logger closetag(int mask)
          close the tag
 Logger cr()
          prints a cr and indentation
 Logger cr(int mask)
          prints a cr and indentation
 Logger element(int mask, java.lang.String name)
          opens a log line with a XML tag "name"
 Logger element(java.lang.String name)
          opens a log line with a XML tag "name"
 int mode()
          returns the mode of this logger
 Logger print(int mask, java.lang.String name)
          prints text to output, with indentation if required
 Logger print(java.lang.String name)
          prints text to output, with indentation if required
 Logger println(int mask, java.lang.String name)
          prints text to output, with indentation if required
 Logger println(java.lang.String name)
          prints text to output, with indentation if required
 Logger thisLogger()
          returns this logger
 

Field Detail

LOG_NONE

static final int LOG_NONE
See Also:
Constant Field Values

LOG_MODES

static final int LOG_MODES
See Also:
Constant Field Values

LOG_PARAMETERS

static final int LOG_PARAMETERS
See Also:
Constant Field Values

LOG_INPUT

static final int LOG_INPUT
See Also:
Constant Field Values

LOG_OUTPUT

static final int LOG_OUTPUT
See Also:
Constant Field Values

LOG_ERRORS

static final int LOG_ERRORS
See Also:
Constant Field Values

LOG_PROCESSES

static final int LOG_PROCESSES
See Also:
Constant Field Values

LOG_MESSAGES

static final int LOG_MESSAGES
See Also:
Constant Field Values

LOG_FILES

static final int LOG_FILES
See Also:
Constant Field Values

LOG_ACTIONS

static final int LOG_ACTIONS
See Also:
Constant Field Values

LOG_ALL

static final int LOG_ALL
See Also:
Constant Field Values

LOG_NORMAL

static final int LOG_NORMAL
See Also:
Constant Field Values
Method Detail

mode

int mode()
returns the mode of this logger


thisLogger

Logger thisLogger()
returns this logger


element

Logger element(int mask,
               java.lang.String name)
opens a log line with a XML tag "name"


element

Logger element(java.lang.String name)
opens a log line with a XML tag "name"


print

Logger print(int mask,
             java.lang.String name)
prints text to output, with indentation if required


print

Logger print(java.lang.String name)
prints text to output, with indentation if required


println

Logger println(int mask,
               java.lang.String name)
prints text to output, with indentation if required


println

Logger println(java.lang.String name)
prints text to output, with indentation if required


cr

Logger cr(int mask)
prints a cr and indentation


cr

Logger cr()
prints a cr and indentation


closeelement

Logger closeelement(int mask)
closes the element line


closeelement

Logger closeelement()
closes the element line


closeelement

Logger closeelement(int mask,
                    java.lang.String name)
closes the element line, checking correct name


closeelement

Logger closeelement(java.lang.String name)
closes the element line, checking correct name


closetag

Logger closetag(int mask)
close the tag


closetag

Logger closetag()
close the tag


attribute

Logger attribute(int mask,
                 java.lang.String name,
                 java.lang.String value)
add attribute to an opened tag


attribute

Logger attribute(java.lang.String name,
                 java.lang.String value)
add attribute to an opened tag


attribute

Logger attribute(int mask,
                 java.lang.String name,
                 boolean value)
add attribute to an opened tag


attribute

Logger attribute(java.lang.String name,
                 boolean value)
add attribute to an opened tag


attribute

Logger attribute(int mask,
                 java.lang.String name,
                 int value)
add attribute to an opened tag


attribute

Logger attribute(java.lang.String name,
                 int value)
add attribute to an opened tag