|
Enhydra 3.1 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.lutris.logging.Logger | +--com.lutris.logging.StandardLogger
Standard implementation of the Logger
. This is
general-purpose logging facility. A client that needs additional
functionality can either extend this class or provide there own
implementationm of Logger
.
Currently this is a bare-bones class that writes INFO and above levels to stderr and all others to a log file.
Logger
,
LogChannel
,
StandardLogChannel
Field Summary | |
protected boolean[] |
enabledLevelFlags
Table of levels that are to be enabled. |
protected java.lang.String[] |
levelNames
Table translating level number to name and the largest entry in the array that is valid. |
protected boolean[] |
logFileLevelFlags
Table of levels that are to be written to the log file. |
protected int |
numLevels
|
protected boolean[] |
stderrLevelFlags
Table of levels that are to be written to stderr Accessed directly by the channel. |
Fields inherited from class com.lutris.logging.Logger |
ALERT,
centralLogger,
CRITICAL,
DEBUG,
DEBUG1,
DEBUG2,
DEBUG3,
DEBUG4,
DEBUG5,
DEBUG6,
DEBUG7,
DEBUG8,
DEBUG9,
DEBUGTMP,
EMERGENCY,
ERROR,
INFO,
MAX_STD_LEVEL,
NOTICE,
standardLevelNames,
WARNING |
Constructor Summary | |
StandardLogger(boolean makeCentral)
Construct a new logger. |
Method Summary | |
void |
configure(java.io.File logFile,
java.lang.String[] fileLevels,
java.lang.String[] stderrLevels)
Configure the logger. |
LogChannel |
getChannel(java.lang.String facility)
Get the log channel object for a facility. |
int |
getLevel(java.lang.String level)
Convert a symbolic level to an integer identifier, creating it if it doesn't exist |
java.lang.String |
getLevelName(int level)
Convert an int to a symbolic level name. |
java.io.File |
switchLogFile(java.io.File logFile)
Switch a log file; replacing the old one with a new one. |
Methods inherited from class com.lutris.logging.Logger |
getCentralLogger |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.lang.String[] levelNames
protected int numLevels
protected boolean[] enabledLevelFlags
protected boolean[] logFileLevelFlags
protected boolean[] stderrLevelFlags
Constructor Detail |
public StandardLogger(boolean makeCentral)
makeCentral
- Make this object the central logging object.Method Detail |
public java.io.File switchLogFile(java.io.File logFile) throws java.io.IOException
logFile
- The new log file.public void configure(java.io.File logFile, java.lang.String[] fileLevels, java.lang.String[] stderrLevels) throws java.io.IOException
logFile
- The log file to write to.fileLevels
- List of levels that will be written to the file.stderrLevels
- List of levels that will be written to stderr.
The same level may appear in both lists.public LogChannel getChannel(java.lang.String facility)
facility
- Facility the channel is associated with.public int getLevel(java.lang.String level)
level
- Symbolic level that is to be checked.public java.lang.String getLevelName(int level)
level
- an int level.
|
Enhydra 3.1 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |