Interface LogInterface
- All Known Implementing Classes:
ConsoleLog,GenericLog,JulLog,Log4j2Log,Slf4jLog,TextLog,UiLog
debug - Can be turned off
info - Generated during the course of normal operations
warning - Something strange has happened
error - Something bad has happened but the application is still working
systemError - Something that's really bad and is never supposed to happen has happened. The application will usually stop after one of these.
Each message has two methods to call it - a simple method which has the message text as the sole parameter and a more detailed method which allows the developer to specify
isModal - whether a modal window should come up
isLogged - whether the message should be logged to a file or other persistant storage mechanism.
Although present in the interface the above two features do not have to work in all implementations.
There are also a couple of housekeeping Methods that need to implemented
flush() - Flushes any log files being written to.
getCurrentLogFile() - Returns name of current log file.
See LogInterface
Copyright 2003-2026 ATB Consultancy Services Ltd
(formerly Orinda Software Ltd, Dublin, Ireland)
- Version:
- 7
- Author:
- [email protected]
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstant used when formatting message stringsstatic final StringConstant for the field delimiter used in log messagesstatic final StringDefault format for day component of log file names.static final StringDefault format for time component of log file names.static final StringConstant for the time format used in log messagesstatic final StringConstant used when formatting message stringsstatic final StringConstant used when formatting message stringsstatic final StringConstant used when formatting message stringsstatic final StringConstant used when formatting message strings -
Method Summary
Modifier and TypeMethodDescriptionvoidLog a debug message.voidLog a debug message.voiddebugOff()Turn debug messages offvoiddebugOn()Turn debug messages onvoidLog an Exception.voidLog an error message.voidLog an error message.voidLog an error message.voidflush()If the log is buffered then flush any outstanding changes.Returns a string with the name of the current log.Returns the current Date FormatbooleangetDebug()Get debug statusvoidLog an informational message.voidLog an informational message.voidsetAutoFlush(boolean flushEveryMessage) Controls whether the class should flush the log every time it is asked to print a message.voidsetAutoLog(boolean logEveryMessageByDefault) Controls whether the class should log every message unless told not to.voidLog a serious Exception.voidLog a serious Exception.voidLog a serious error message.voidLog a serious error message.voidLog a warning message.voidLog a warning message.
-
Field Details
-
DEBUG
-
INFO
-
WARN
-
ERROR
-
SYSERR
-
DEFAULT_TIME_FORMAT_STRING
Constant for the time format used in log messages- See Also:
-
DEFAULT_FILENAME_DAY_FORMAT
Default format for day component of log file names.- See Also:
-
DEFAULT_FILENAME_TIME_FORMAT
Default format for time component of log file names.- See Also:
-
DEFAULT_FIELD_DELIMITER
Constant for the field delimiter used in log messages- See Also:
-
-
Method Details
-
debugOn
void debugOn()Turn debug messages on -
debugOff
void debugOff()Turn debug messages off -
getDebug
boolean getDebug()Get debug status- Returns:
trueif debug messages are being printed.
-
debug
Log a debug message. The user does not have to see it. It will always be logged.- Parameters:
theMessage- A string containing the message.
-
debug
Log a debug message. The user may be forced to acknowledge it. It may be logged. Debug messages are off by default.- Parameters:
theMessage- A string containing the message.isModal-trueif the user must be forced to acknowlege this message. Only meaningful if a GUI is in use.isLogged-trueif this message is to be stored somewhere.
-
info
Log an informational message. The user does not have to acknowlege it. It will not be logged.- Parameters:
theMessage- A string containing the message.
-
info
Log an informational message. The user may be forced to acknowledge it. It may be logged.- Parameters:
theMessage- A string containing the message.isModal-trueif the user must be forced to acknowlege this message. Only meaningful if a GUI is in use.isLogged-trueif this message is to be stored somewhere.
-
warning
Log a warning message. The user does not have to acknowlege it. It will not be logged.- Parameters:
theMessage- A string containing the message.
-
warning
Log a warning message. The user may be forced to acknowledge it. It may be logged.- Parameters:
theMessage- A string containing the message.isModal-trueif the user must be forced to acknowlege this message. Only meaningful if a GUI is in use.isLogged-trueif this message is to be stored somewhere.
-
error
Log an error message. The user does not have to acknowlege it. It will not be logged.- Parameters:
theMessage- A string containing the message.
-
error
Log an error message. The user may be forced to acknowledge it. It may be logged.- Parameters:
theMessage- A string containing the message.isModal-trueif the user must be forced to acknowlege this message. Only meaningful if a GUI is in use.isLogged-trueif this message is to be stored somewhere.
-
error
Log an Exception. The user does not have to acknowlege it. It will not be logged.- Parameters:
theException- A string containing the message.
-
error
Log an error message. The user may be forced to acknowledge it. It may be logged.- Parameters:
theException- A string containing the message.isModal-trueif the user must be forced to acknowlege this message. Only meaningful if a GUI is in use.isLogged-trueif this message is to be stored somewhere.
-
syserror
Log a serious error message. The user does not have to acknowlege it. It will not be logged.- Parameters:
theMessage- A string containing the message.
-
syserror
Log a serious error message. The user may be forced to acknowledge it. It may be logged.- Parameters:
theMessage- A string containing the message.isModal-trueif the user must be forced to acknowlege this message. Only meaningful if a GUI is in use.isLogged-trueif this message is to be stored somewhere.
-
syserror
Log a serious Exception. The user does not have to acknowlege it. It will not be logged.- Parameters:
theException- A string containing the message.
-
syserror
Log a serious Exception. The user may be forced to acknowledge it. It may be logged.- Parameters:
theException- A string containing the message.isModal-trueif the user must be forced to acknowlege this message. Only meaningful if a GUI is in use.isLogged-trueif this message is to be stored somewhere.
-
setAutoFlush
void setAutoFlush(boolean flushEveryMessage) Controls whether the class should flush the log every time it is asked to print a message. Slower but more reliable.- Parameters:
flushEveryMessage-trueif the log is to be flushed every time a message is written to it.
-
flush
void flush()If the log is buffered then flush any outstanding changes. If the log is not buffered do nothing. -
getCurrentLog
String getCurrentLog()Returns a string with the name of the current log.- Returns:
- A full path name if a conventional log file is in use, or a descriptive string if no log file is in use.
-
setAutoLog
void setAutoLog(boolean logEveryMessageByDefault) Controls whether the class should log every message unless told not to.- Parameters:
logEveryMessageByDefault-trueif messages are to be logged by default.
-
getDateFormat
-