uk.ac.bham.gloss
Class MCBLogger

java.lang.Object
  extended by uk.ac.bham.gloss.NullLogger
      extended by uk.ac.bham.gloss.MCBLogger
All Implemented Interfaces:
Logger

public class MCBLogger
extends NullLogger

A Logger object presents a "log" of an execution, eg, for debugging. This one writes all output to a MessageCallBack object. 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
MCBLogger(int mode, MessageCallBack mcb)
          Create a logger that logs all messages matching mode
 
Method Summary
 void doattribute(java.lang.String name, boolean value)
          add attribute to an opened tag
 void doattribute(java.lang.String name, int value)
          add attribute to an opened tag
 void doattribute(java.lang.String name, java.lang.String value)
          add attribute to an opened tag
 void docloseelement()
          closes the element line
 void docloseelement(java.lang.String name)
          closes the element line, checking correct name
 void doclosetag()
          close the tag
 void docr()
          prints cr and require indentation on next line
 void doelement(java.lang.String name)
          opens a log line with a XML tag "name"
 void doprint(java.lang.String text)
          prints text to output
 void doprintln(java.lang.String text)
          prints text to output
 int mode()
          returns an int value indicating type of log
 Logger thisLogger()
          Returns this logger
 
Methods inherited from class uk.ac.bham.gloss.NullLogger
attribute, attribute, attribute, attribute, attribute, attribute, closeelement, closeelement, closeelement, closeelement, closetag, closetag, cr, cr, element, element, lastmask, print, print, println, println
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MCBLogger

public MCBLogger(int mode,
                 MessageCallBack mcb)
Create a logger that logs all messages matching mode

Method Detail

thisLogger

public Logger thisLogger()
Returns this logger

Specified by:
thisLogger in interface Logger
Overrides:
thisLogger in class NullLogger

mode

public int mode()
returns an int value indicating type of log

Specified by:
mode in interface Logger
Overrides:
mode in class NullLogger

docr

public void docr()
prints cr and require indentation on next line

Overrides:
docr in class NullLogger

doelement

public void doelement(java.lang.String name)
opens a log line with a XML tag "name"

Overrides:
doelement in class NullLogger

doprint

public void doprint(java.lang.String text)
prints text to output

Overrides:
doprint in class NullLogger

doprintln

public void doprintln(java.lang.String text)
prints text to output

Overrides:
doprintln in class NullLogger

docloseelement

public void docloseelement()
closes the element line

Overrides:
docloseelement in class NullLogger

docloseelement

public void docloseelement(java.lang.String name)
closes the element line, checking correct name

Overrides:
docloseelement in class NullLogger

doclosetag

public void doclosetag()
close the tag

Overrides:
doclosetag in class NullLogger

doattribute

public void doattribute(java.lang.String name,
                        java.lang.String value)
add attribute to an opened tag

Overrides:
doattribute in class NullLogger

doattribute

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

Overrides:
doattribute in class NullLogger

doattribute

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

Overrides:
doattribute in class NullLogger