|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--net.directj.jlogger.JLogger
This class is the logging tool class. See the package documentation for how to use it.
Field Summary | |
static int |
ALL
The ALL logging level. |
private java.util.ArrayList |
buffer
The String buffer that contains the debugging text. |
static int |
BUFFER_MAXIMUM_SIZE
The maximum buffer size. |
private int |
bufferSize
The maximum size of the buffer. |
static int |
DEBUG
The DEBUG logging level. |
static int |
DEBUG_TYPE
The DEBUG logging information's type. |
static int |
ERROR
The ERROR logging level. |
static int |
ERROR_TYPE
The ERROR logging information's type. |
static int |
FATAL
The FATAL logging level. |
static int |
FATAL_TYPE
The FATAL logging information's type |
static int |
INFO
The INFO logging level. |
static int |
INFO_TYPE
The INFO logging information's type. |
private java.lang.String |
loggerName
The logger name. |
private java.util.ArrayList |
managers
The log manager list. |
private int |
nbrManager
The number of manager associated with the logger. |
static int |
OFF
The OFF logging level. |
static int |
WARNING
The WARNING logging level. |
static int |
WARNING_TYPE
The WARNING logging information's type. |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
protected |
JLogger(java.lang.String _name)
Creates a new Logger, with a specified name. |
protected |
JLogger(java.lang.String _name,
int _bufferSize)
Creates a new Logger, with a specified name. |
Method Summary | |
void |
addLogManager(LogManager _manager)
Adds a new LogManager to the list of manager. |
void |
debug(java.lang.String _message)
Prints information with a DEBUG type. |
void |
debug(java.lang.String _message,
java.lang.Throwable _excp)
Prints information with a DEBUG type, then print the exception. |
void |
error(java.lang.String _message)
Prints information with a ERROR type. |
void |
error(java.lang.String _message,
java.lang.Throwable _excp)
Prints information with a ERROR type, then print the exception. |
void |
exception(int _lvl,
java.lang.Throwable _excp)
Prints an exception or an error, with an specified type. |
void |
fatal(java.lang.String _message)
Prints information with a FATAL type. |
void |
fatal(java.lang.String _message,
java.lang.Throwable _excp)
Prints information with a FATAL type, then print the exception. |
java.util.Collection |
getAllLogManager()
Returns a collection that contain all the log manager |
java.lang.String |
getLoggerName()
Returns the name of this logger instance. |
LogManager |
getLogManager(int _index)
Returns the _indexth log manager. |
void |
info(java.lang.String _message)
Prints information with a INFO type. |
void |
info(java.lang.String _message,
java.lang.Throwable _excp)
Prints information with a DEBUG type, then print the exception. |
void |
log(int _type,
java.lang.String _msg)
This is the method that is used to publish the informations. |
void |
removeLogManager(LogManager _manager)
Removes the specified LogManager to the list of manager. |
void |
warning(java.lang.String _message)
Prints information with a WARNING type. |
void |
warning(java.lang.String _message,
java.lang.Throwable _excp)
Prints information with a WARNING type, then print the exception. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int ALL
public static final int DEBUG
public static final int INFO
public static final int WARNING
public static final int ERROR
public static final int FATAL
public static final int OFF
public static final int DEBUG_TYPE
public static final int INFO_TYPE
public static final int WARNING_TYPE
public static final int ERROR_TYPE
public static final int FATAL_TYPE
public static final int BUFFER_MAXIMUM_SIZE
private java.util.ArrayList managers
private java.util.ArrayList buffer
private java.lang.String loggerName
private int nbrManager
private int bufferSize
Constructor Detail |
protected JLogger(java.lang.String _name)
_name
- The logger name.JLoggerFactory.getLogger(String)
protected JLogger(java.lang.String _name, int _bufferSize)
_name
- The logger name._bufferSize
- The maximum size of the trace buffer.JLoggerFactory.getLogger(String)
Method Detail |
public final void addLogManager(LogManager _manager)
_manager
- The LogManager to add.public final void removeLogManager(LogManager _manager)
_manager
- The LogManager to remove.public final java.util.Collection getAllLogManager()
Collection
- The managers collection.public final LogManager getLogManager(int _index)
_index
- The rank of the manager we want.
LogManager
- The _indexth log manager, or null.public final java.lang.String getLoggerName()
String
- The logger name.public final void log(int _type, java.lang.String _msg)
_type
- The logging information level._msg
- The logging information.public void exception(int _lvl, java.lang.Throwable _excp)
_lvl
- The level of the exception._excp
- The catched throwable object.public void debug(java.lang.String _message)
_message
- The information.public void debug(java.lang.String _message, java.lang.Throwable _excp)
_message
- The information._excp
- The exception that justify the message.public void info(java.lang.String _message)
_message
- The information.public void info(java.lang.String _message, java.lang.Throwable _excp)
_message
- The information._excp
- The exception that justify the message.public void warning(java.lang.String _message)
_message
- The information.public void warning(java.lang.String _message, java.lang.Throwable _excp)
_message
- The information._excp
- The exception that justify the message.public void error(java.lang.String _message)
_message
- The information.public void error(java.lang.String _message, java.lang.Throwable _excp)
_message
- The information._excp
- The exception that justify the message.public void fatal(java.lang.String _message)
_message
- The information.public void fatal(java.lang.String _message, java.lang.Throwable _excp)
_message
- The information._excp
- The exception that justify the message.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |