net.directj.jlogger
Class LogManager

java.lang.Object
  |
  +--net.directj.jlogger.LogManager
Direct Known Subclasses:
ConsoleLogManager, FileLogManager, HtmlLogManager, JDBCLogManager, JTableLogManager, JTextLogManager, NetworkLogManager, XmlLogManager

public class LogManager
extends java.lang.Object

This class is a manager for the logging output. By using this class, you can have more than one output, and a special format for each output. In fact, it is a class that have a formatter, an output and a level. If the information level is greater or equals than the manager's one, then the information is formatted using the Formatter class, and it is written using the Output class.

Version:
0.1.4
Author:
CARTAPANIS Alexandre <earendil@jprolog.net>
See Also:
Formatter, Output

Field Summary
private  Formatter format
          The output formatter.
private  int level
          The current level.
private  Output out
          The output.
 
Constructor Summary
LogManager(int _level, Formatter _format, Output _output)
          Creates a new LogManager, with the specified logging level, format and output.
 
Method Summary
 boolean equals(java.lang.Object _obj)
          Indicates whether some other object is "equal to" this one.
 int hashCode()
          Returns a hash code value for the object.
private  boolean isPublishableLevel(int _type)
          Says if the information is publishable or not.
 void log(LogRecord _rec)
          This is the method that is used to publish the informations.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

format

private Formatter format
The output formatter.


out

private Output out
The output.


level

private int level
The current level.

Constructor Detail

LogManager

public LogManager(int _level,
                  Formatter _format,
                  Output _output)
Creates a new LogManager, with the specified logging level, format and output.

Parameters:
_level - The logging level.
_format - The logging format.
_output - The logging output.
Method Detail

log

public final void log(LogRecord _rec)
This is the method that is used to publish the informations. The LogRecord will be print onto the output, using the formatter, only if the manager level is equal or inferior than the log record type.

Parameters:
_rec - The LogRecord to be print.

isPublishableLevel

private final boolean isPublishableLevel(int _type)
Says if the information is publishable or not.

Parameters:
_type - The information's type.
Returns:
boolean - True if the information is publishable, false otherwise.

equals

public boolean equals(java.lang.Object _obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class java.lang.Object
Parameters:
_obj - The reference object with which to compare.
Returns:
boolean - True if this object is the same as the obj argument; false otherwise.

hashCode

public int hashCode()
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

Overrides:
hashCode in class java.lang.Object
Returns:
int - A hash code value for this object.


Copyright © 2002 CARTAPANIS Alexandre
This page was last updated on May 10 2003