public class QBPFileLogger extends AQBPLogger
time-stamp level 'message [reason]'
Where:
time-stamp is a time stamp with the format:
[yyyy-MM-ddTHH-mm-ss.SSS]
This records the time the log call was made.
level is the log level. It is one of:
message is the log message.
reason is included only if a throwable reason object was
included in the log call. It has the format:
Reason: 'throwable-message'
where throwable-message is the message from the reason object.
AQBPLogger.LogLevel, AQBPLogger.QBPConfigException, AQBPLogger.QBPException
Constructor and Description |
---|
QBPFileLogger(java.io.File log_file)
Create a logger that logs to the given file.
|
QBPFileLogger(java.io.PrintStream log_stream)
Log to an existing stream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the logger.
|
protected java.lang.String |
sendConfigError(java.lang.String raw_msg)
Format a configuration error message and send it to the log.
|
protected java.lang.String |
sendConfigError(java.lang.String raw_msg,
java.lang.Throwable reason)
Format a configuration error message and send it to the log with a reason.
|
protected java.lang.String |
sendError(java.lang.String raw_msg)
Format an error message and send it to the log.
|
protected java.lang.String |
sendError(java.lang.String raw_msg,
java.lang.Throwable reason)
Format an error message and send it to the log with a reason.
|
protected java.lang.String |
sendInfo(java.lang.String raw_msg)
Format an information message and send it to the log.
|
protected java.lang.String |
sendTrace(java.lang.String raw_msg)
Format a Trace message and send it to the log.
|
protected java.lang.String |
sendWarning(java.lang.String raw_msg)
Format a warning message and send it to the log.
|
protected java.lang.String |
sendWarning(java.lang.String raw_msg,
java.lang.Throwable reason)
Format a warning message with a reason and send it to the log.
|
getConfigNoteCount, isConfigExceptionModeOn, isStandardExceptionModeOn, logConfigError, logConfigError, logConfigFatal, logConfigFatal, logError, logError, logFatal, logFatal, logInfo, logTrace, logWarning, logWarning, popConfig, pushConfig, setConfig, setEnabledLevels, turnOffConfigExceptionMode, turnOffConfigNotes, turnOffStandardExceptionMode, turnOnConfigExceptionMode, turnOnConfigNotes, turnOnStandardExceptionMode
public QBPFileLogger(java.io.File log_file) throws java.lang.IllegalArgumentException
log_file
- log messages are appended to this file.java.lang.IllegalArgumentException
- if could not create or open
for writting this file for any reason.public QBPFileLogger(java.io.PrintStream log_stream)
Caution! If other data is being written to the stream log messages could be lost. Write operations are synchronized on the given stream, but the logger cannot enforce others to also synchronize on the stream.
The close method of this object will not close the given stream.
log_stream
- the stream for all log messages.public void close()
protected java.lang.String sendError(java.lang.String raw_msg)
sendError
in class AQBPLogger
raw_msg
- the error message.protected java.lang.String sendError(java.lang.String raw_msg, java.lang.Throwable reason)
sendError
in class AQBPLogger
raw_msg
- the error message.reason
- the thrown exception that triggered this call.protected java.lang.String sendConfigError(java.lang.String raw_msg)
sendConfigError
in class AQBPLogger
raw_msg
- the error message.protected java.lang.String sendConfigError(java.lang.String raw_msg, java.lang.Throwable reason)
sendConfigError
in class AQBPLogger
raw_msg
- the error message.reason
- the thrown exception that triggered this call.protected java.lang.String sendWarning(java.lang.String raw_msg)
sendWarning
in class AQBPLogger
raw_msg
- the error message.protected java.lang.String sendWarning(java.lang.String raw_msg, java.lang.Throwable reason)
sendWarning
in class AQBPLogger
raw_msg
- the error message.reason
- the thrown exception that triggered this call.protected java.lang.String sendInfo(java.lang.String raw_msg)
sendInfo
in class AQBPLogger
raw_msg
- the error message.protected java.lang.String sendTrace(java.lang.String raw_msg)
sendTrace
in class AQBPLogger
raw_msg
- the error message.