uk.org.iscream.cms.server.core.loggers
Class MultiLogger

java.lang.Object
  |
  +--uk.org.iscream.cms.server.core.loggers.MultiLogger
All Implemented Interfaces:
LoggerImpl

public class MultiLogger
extends Object
implements LoggerImpl

The MultiLogger is just a gateway to both the ScreenLogger and the FileLogger.

Version:
$Id: MultiLogger.java,v 1.11 2003/02/05 16:43:47 tdb Exp $
Author:
$Author: tdb $

Field Summary
private  LoggerImpl _filelog
          A reference to the FileLogger we'll use
private  String _name
          This is the friendly identifier of the component this class is running in.
private  LoggerImpl _screenlog
          A reference to the ScreenLogger we'll use
 String REVISION
          The current CVS revision of this class
 
Constructor Summary
MultiLogger()
          Creates a new MultiLogger.
 
Method Summary
 String toString()
          Overrides the Object.toString() method to provide clean logging (every class should have this).
 void write(String line, int verbosity)
          The write() method takes a line of text, pre-formatted and outputs it using a method defined by the actual implementation.
private  void write(String source, int verbosity, String message)
          This method is provided if this class wishes to log a message itself.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REVISION

public final String REVISION
The current CVS revision of this class

See Also:
Constant Field Values

_screenlog

private LoggerImpl _screenlog
A reference to the ScreenLogger we'll use


_filelog

private LoggerImpl _filelog
A reference to the FileLogger we'll use


_name

private String _name
This is the friendly identifier of the component this class is running in. eg, a Filter may be called "filter1", If this class does not have an owning component, a name from the configuration can be placed here. This name could also be changed to null for utility classes.

Constructor Detail

MultiLogger

public MultiLogger()
            throws IOException
Creates a new MultiLogger.

Method Detail

write

public void write(String line,
                  int verbosity)
The write() method takes a line of text, pre-formatted and outputs it using a method defined by the actual implementation. The verbosity is given in case the implementation wishes to utilise it in the layout - eg. a different colour or font. This instance passes the message on to a ScreenLogger and a FileLogger.

Specified by:
write in interface LoggerImpl
Parameters:
line - A line of formatted text to be logged
verbosity - the verbosity of this message

toString

public String toString()
Overrides the Object.toString() method to provide clean logging (every class should have this). This uses the uk.org.iscream.cms.util.FormatName class to format the toString()

Overrides:
toString in class Object
Returns:
the name of this class and its CVS revision

write

private void write(String source,
                   int verbosity,
                   String message)
This method is provided if this class wishes to log a message itself.

Parameters:
source - A String representation of the source
verbosity - the verbosity of this message
message - The message to log


Copyright © 2000-2003 i-scream. All Rights Reserved.