Defines methods available to clients that want to write a log message to their Geode system's shared log file.
More...
|
static LogLevel | charsToLevel (const char *chars) |
| returns log level specified by "chars", or throws IllegalArgumentException. More...
|
|
static void | close () |
| closes logging facility (until next init). More...
|
|
static void | config (const char *msg) |
| Logs a message. More...
|
|
static void | configCatch (const char *msg, const Exception &ex) |
| Writes both a message and caught exception. More...
|
|
static bool | configEnabled () |
| Returns whether "config" log messages are enabled. More...
|
|
static void | configThrow (const char *msg, const Exception &ex) |
| Logs both a message and thrown exception. More...
|
|
static void | debug (const char *msg) |
| Logs a message. More...
|
|
static void | debugCatch (const char *msg, const Exception &ex) |
| Writes both a message and caught exception. More...
|
|
static bool | debugEnabled () |
| Returns whether "debug" log messages are enabled. More...
|
|
static void | debugThrow (const char *msg, const Exception &ex) |
| Logs both a message and thrown exception. More...
|
|
static bool | enabled (LogLevel level) |
| Returns whether log messages at given level are enabled. More...
|
|
static void | error (const char *msg) |
| Logs a message. More...
|
|
static void | errorCatch (const char *msg, const Exception &ex) |
| Writes both a message and caught exception. More...
|
|
static bool | errorEnabled () |
| Returns whether "error" log messages are enabled. More...
|
|
static void | errorThrow (const char *msg, const Exception &ex) |
| Logs both a message and thrown exception. More...
|
|
static void | fine (const char *msg) |
| Logs a message. More...
|
|
static void | fineCatch (const char *msg, const Exception &ex) |
| Writes both a message and caught exception. More...
|
|
static bool | fineEnabled () |
| Returns whether "fine" log messages are enabled. More...
|
|
static void | finer (const char *msg) |
| Logs a message. More...
|
|
static void | finerCatch (const char *msg, const Exception &ex) |
| Writes both a message and caught exception. More...
|
|
static bool | finerEnabled () |
| Returns whether "finer" log messages are enabled. More...
|
|
static void | finerThrow (const char *msg, const Exception &ex) |
| Logs both a message and thrown exception. More...
|
|
static void | finest (const char *msg) |
| Logs a message. More...
|
|
static void | finestCatch (const char *msg, const Exception &ex) |
| Writes both a message and caught exception. More...
|
|
static bool | finestEnabled () |
| Returns whether "finest" log messages are enabled. More...
|
|
static void | finestThrow (const char *msg, const Exception &ex) |
| Logs both a message and thrown exception. More...
|
|
static void | fineThrow (const char *msg, const Exception &ex) |
| Logs both a message and thrown exception. More...
|
|
static char * | formatLogLine (char *buf, LogLevel level) |
| Fills the provided buffer with formatted log-line given the level and returns the buffer. More...
|
|
static void | info (const char *msg) |
| Logs a message. More...
|
|
static void | infoCatch (const char *msg, const Exception &ex) |
| Writes both a message and caught exception. More...
|
|
static bool | infoEnabled () |
| Returns whether "info" log messages are enabled. More...
|
|
static void | infoThrow (const char *msg, const Exception &ex) |
| Logs both a message and thrown exception. More...
|
|
static void | init (LogLevel level, const char *logFileName, int32_t logFileLimit=0, int64_t logDiskSpaceLimit=0) |
| Initializes logging facility with given level and filenames. More...
|
|
static const char * | levelToChars (Log::LogLevel level) |
| returns character string for given log level. More...
|
|
static void | log (LogLevel level, const char *msg) |
| Logs a message at given level. More...
|
|
static void | logCatch (LogLevel level, const char *msg, const Exception &ex) |
| Logs both a message and caught exception. More...
|
|
static const char * | logFileName () |
|
static LogLevel | logLevel () |
| Returns the current log level. More...
|
|
static void | logThrow (LogLevel level, const char *msg, const Exception &ex) |
| Logs both a message and thrown exception. More...
|
|
static void | setLogLevel (LogLevel level) |
| Set the current log level. More...
|
|
static void | warning (const char *msg) |
| Logs a message. More...
|
|
static void | warningCatch (const char *msg, const Exception &ex) |
| Writes both a message and caught exception. More...
|
|
static bool | warningEnabled () |
| Returns whether "warning" log messages are enabled. More...
|
|
static void | warningThrow (const char *msg, const Exception &ex) |
| Logs both a message and thrown exception. More...
|
|
Defines methods available to clients that want to write a log message to their Geode system's shared log file.
This class must be initialized prior to its use: Log::init
For any logged message the log file will contain:
-
The message's level.
-
The time the message was logged.
-
The id of the connection and thread that logged the message.
-
The message itself which can be a const char* (perhaps with an exception including the exception's stack trace.
A message always has a level. Logging levels are ordered. Enabling logging at a given level also enables logging at higher levels. The higher the level the more important and urgent the message.
The levels, in descending order of severity, are:
-
error
(highest severity) is a message level indicating a serious failure. In general error
messages should describe events that are of considerable importance and which will prevent normal program execution. They should be reasonably intelligible to end users and to system administrators.
-
warning
is a message level indicating a potential problem. In general warning
messages should describe events that will be of interest to end users or system managers, or which indicate potential problems.
-
info
is a message level for informational messages. Typically info
messages should be reasonably significant and should make sense to end users and system administrators.
-
config
is a message level for static configuration messages. config
messages are intended to provide a variety of static configuration information, to assist in debugging problems that may be associated with particular configurations.
-
fine
is a message level providing tracing information. In general the fine
level should be used for information that will be broadly interesting to developers. This level is for the lowest volume, and most important, tracing messages.
-
finer
indicates a moderately detailed tracing message. This is an intermediate level between fine
and finest
.
-
finest
indicates a very detailed tracing message. Logging calls for entering, returning, or throwing an exception are traced at the finest
level.
-
debug
(lowest severity) indicates a highly detailed tracing message. In general the debug
level should be used for the most voluminous detailed tracing messages.
For each level methods exist that will request a message, at that level, to be logged. These methods are all named after their level.
For each level a method exists that indicates if messages at that level will currently be logged. The names of these methods are of the form: levelEnabled
.