| |
|
| java.lang.Object com.lutris.logging.Logger com.lutris.logging.StandardLogger
StandardLogger | public class StandardLogger extends Logger (Code) | | 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.
author: Mark Diekhans See Also: com.lutris.logging.Logger See Also: com.lutris.logging.LogChannel See Also: com.lutris.logging.StandardLogChannel |
Constructor Summary | |
public | StandardLogger(boolean makeCentral) Construct a new logger. |
Method Summary | |
public synchronized void | configure(File logFile, String[] fileLevels, String[] stderrLevels) Configure the logger. | public void | configure(String confFilePath) Configure Logger with given config file, interpreting of config file is
logger implementation specific. | public void | configure(Config logConfig) | public LogChannel | getChannel(String facility) Get the log channel object for a facility. | public synchronized int | getLevel(String level) Convert a symbolic level to an integer identifier,
creating it if it doesn't exist
Parameters: level - Symbolic level that is to be checked. | public String | getLevelName(int level) Convert an int to a symbolic level name.
Parameters: level - an int level. | public synchronized File | switchLogFile(File logFile) Switch a log file; replacing the old one with a new one.
Parameters: logFile - The new log file. |
activeLogFile | File activeLogFile(Code) | | Log file name.
|
enabledLevelFlags | protected boolean[] enabledLevelFlags(Code) | | Table of levels that are to be enabled.
Accessed directly by the channel. If null, ignored.
|
levelNames | protected String[] levelNames(Code) | | Table translating level number to name and the largest entry in the
array that is valid. Will be expanded if needed.
|
logFileLevelFlags | protected boolean[] logFileLevelFlags(Code) | | Table of levels that are to be written to the log file.
Accessed directly by the channel. If null, ignored.
|
logFileStream | PrintWriter logFileStream(Code) | | Log file writter. Use directly by channels.
|
numLevels | protected int numLevels(Code) | | |
stderrLevelFlags | protected boolean[] stderrLevelFlags(Code) | | Table of levels that are to be written to stderr
Accessed directly by the channel. If null, then
the default behavior of writing serious standard
levels to stderr is in affect.
|
stderrStream | PrintWriter stderrStream(Code) | | Stderr writter. Use directly by channels.
|
StandardLogger | public StandardLogger(boolean makeCentral)(Code) | | Construct a new logger. Configuration is not done now, to allow
the logger to be created very early.
Parameters: makeCentral - Make this object the central logging object. |
configure | public synchronized void configure(File logFile, String[] fileLevels, String[] stderrLevels) throws java.io.IOException(Code) | | Configure the logger. All current configuration is discarded.
This is a simplistic initial implementation that just allows
directing to a single log file or stderr on a level basis.
A more complete interface will be provided in the future.
Parameters: logFile - The log file to write to. Parameters: fileLevels - List of levels that will be written to the file. Parameters: stderrLevels - List of levels that will be written to stderr.The same level may appear in both lists. exception: java.io.IOException - If an error occurs opening the log file. |
configure | public void configure(String confFilePath) throws ConfigException(Code) | | Configure Logger with given config file, interpreting of config file is
logger implementation specific.
Parameters: confFilePath - Path to configuration file. |
configure | public void configure(Config logConfig) throws ConfigException(Code) | | Configure Logger with given config section
Parameters: logConfig - containing parameters for configuring logger |
getChannel | public LogChannel getChannel(String facility)(Code) | | Get the log channel object for a facility. For a given facility,
the same object is always returned.
Parameters: facility - Facility the channel is associated with. |
getLevel | public synchronized int getLevel(String level)(Code) | | Convert a symbolic level to an integer identifier,
creating it if it doesn't exist
Parameters: level - Symbolic level that is to be checked. The numeric level identifier |
getLevelName | public String getLevelName(int level)(Code) | | Convert an int to a symbolic level name.
Parameters: level - an int level. The String symolic level name or null if there is not one. |
switchLogFile | public synchronized File switchLogFile(File logFile) throws java.io.IOException(Code) | | Switch a log file; replacing the old one with a new one.
Parameters: logFile - The new log file. The File object for the previous log file, or null if therewasn't one. exception: java.io.IOException - If an error occurs opening the log file. |
|
|
|