uk.ac.bham.gloss
Class NullLogger

java.lang.Object
  extended by uk.ac.bham.gloss.NullLogger
All Implemented Interfaces:
Logger
Direct Known Subclasses:
DoubleLogger, MCBLogger

public class NullLogger
extends java.lang.Object
implements Logger

A Logger object presents a "log" of an execution, eg, for debugging. This one swallows all input and does nothing. Subclass this class to make your loggers do something interesting (and save having to write each method twice). Copyright Richard Kaye 2007-8 for GLOSS, http://gloss.bham.ac.uk Usage permitted according to the GPL. No waranty.


Field Summary
 
Fields inherited from interface uk.ac.bham.gloss.Logger
LOG_ACTIONS, LOG_ALL, LOG_ERRORS, LOG_FILES, LOG_INPUT, LOG_MESSAGES, LOG_MODES, LOG_NONE, LOG_NORMAL, LOG_OUTPUT, LOG_PARAMETERS, LOG_PROCESSES
 
Constructor Summary
NullLogger()
          create a logger that logs all messages matching mode
 
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
 void doattribute(java.lang.String name, boolean value)
           
 void doattribute(java.lang.String name, int value)
           
 void doattribute(java.lang.String name, java.lang.String value)
           
 void docloseelement()
           
 void docloseelement(java.lang.String name)
           
 void doclosetag()
           
 void docr()
           
 void doelement(java.lang.String name)
           
 void doprint(java.lang.String text)
           
 void doprintln(java.lang.String text)
           
 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"
protected  int lastmask()
          Returns the mask used in the last method call to this class that specified one and resets that mask to "all".
 int mode()
          returns the mode of this logger
 Logger print(int mask, java.lang.String text)
          prints text to output, with indentation if required
 Logger print(java.lang.String text)
          prints text to output, with indentation if required
 Logger println(int mask, java.lang.String text)
          prints text to output, with indentation if required
 Logger println(java.lang.String text)
          prints text to output, with indentation if required
 Logger thisLogger()
          returns this logger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullLogger

public NullLogger()
create a logger that logs all messages matching mode

Method Detail

mode

public int mode()
Description copied from interface: Logger
returns the mode of this logger

Specified by:
mode in interface Logger

thisLogger

public Logger thisLogger()
Description copied from interface: Logger
returns this logger

Specified by:
thisLogger in interface Logger

lastmask

protected int lastmask()
Returns the mask used in the last method call to this class that specified one and resets that mask to "all". This is useful in defining a multiple logger that sends logs two two different objects, such as DoubleLogger.


cr

public final Logger cr(int mask)
Description copied from interface: Logger
prints a cr and indentation

Specified by:
cr in interface Logger

cr

public final Logger cr()
Description copied from interface: Logger
prints a cr and indentation

Specified by:
cr in interface Logger

docr

public void docr()

element

public final Logger element(int mask,
                            java.lang.String name)
Description copied from interface: Logger
opens a log line with a XML tag "name"

Specified by:
element in interface Logger

element

public final Logger element(java.lang.String name)
Description copied from interface: Logger
opens a log line with a XML tag "name"

Specified by:
element in interface Logger

doelement

public void doelement(java.lang.String name)

print

public final Logger print(int mask,
                          java.lang.String text)
Description copied from interface: Logger
prints text to output, with indentation if required

Specified by:
print in interface Logger

print

public final Logger print(java.lang.String text)
Description copied from interface: Logger
prints text to output, with indentation if required

Specified by:
print in interface Logger

doprint

public void doprint(java.lang.String text)

println

public final Logger println(int mask,
                            java.lang.String text)
Description copied from interface: Logger
prints text to output, with indentation if required

Specified by:
println in interface Logger

println

public final Logger println(java.lang.String text)
Description copied from interface: Logger
prints text to output, with indentation if required

Specified by:
println in interface Logger

doprintln

public void doprintln(java.lang.String text)

closeelement

public final Logger closeelement(int mask)
Description copied from interface: Logger
closes the element line

Specified by:
closeelement in interface Logger

closeelement

public final Logger closeelement()
Description copied from interface: Logger
closes the element line

Specified by:
closeelement in interface Logger

docloseelement

public void docloseelement()

closeelement

public final Logger closeelement(int mask,
                                 java.lang.String name)
Description copied from interface: Logger
closes the element line, checking correct name

Specified by:
closeelement in interface Logger

closeelement

public final Logger closeelement(java.lang.String name)
Description copied from interface: Logger
closes the element line, checking correct name

Specified by:
closeelement in interface Logger

docloseelement

public void docloseelement(java.lang.String name)

closetag

public final Logger closetag(int mask)
Description copied from interface: Logger
close the tag

Specified by:
closetag in interface Logger

closetag

public final Logger closetag()
Description copied from interface: Logger
close the tag

Specified by:
closetag in interface Logger

doclosetag

public void doclosetag()

attribute

public final Logger attribute(int mask,
                              java.lang.String name,
                              java.lang.String value)
Description copied from interface: Logger
add attribute to an opened tag

Specified by:
attribute in interface Logger

attribute

public final Logger attribute(java.lang.String name,
                              java.lang.String value)
Description copied from interface: Logger
add attribute to an opened tag

Specified by:
attribute in interface Logger

doattribute

public void doattribute(java.lang.String name,
                        java.lang.String value)

attribute

public final Logger attribute(int mask,
                              java.lang.String name,
                              int value)
Description copied from interface: Logger
add attribute to an opened tag

Specified by:
attribute in interface Logger

attribute

public final Logger attribute(java.lang.String name,
                              int value)
Description copied from interface: Logger
add attribute to an opened tag

Specified by:
attribute in interface Logger

doattribute

public void doattribute(java.lang.String name,
                        int value)

attribute

public final Logger attribute(int mask,
                              java.lang.String name,
                              boolean value)
Description copied from interface: Logger
add attribute to an opened tag

Specified by:
attribute in interface Logger

attribute

public Logger attribute(java.lang.String name,
                        boolean value)
Description copied from interface: Logger
add attribute to an opened tag

Specified by:
attribute in interface Logger

doattribute

public void doattribute(java.lang.String name,
                        boolean value)