Class Logger#
Defined in File monitor.hpp
Class Documentation#
-
class Logger#
Logger with logging level differentiation.
Public Functions
-
Logger(LogLevel level)#
Construct the logger with the specified threshold level.
- Parameters
level – Threshold level (from enumerated options) (default is
NSET
).
-
Logger(int level)#
Construct the logger with the specified threshold level.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
level – Threshold level (as a non-negative integer) (default is 0).
-
void reset_level(LogLevel level)#
Reset the logger threshold level.
- Parameters
level – Threshold level (from enumerated options).
-
void reset_level(int level)#
Reset the logger threshold level.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
level – Threshold level (as a non-negative integer).
-
void log(LogLevel level_entry, const char *fmt_string, ...)#
Log a message at the specified level.
If the specified level is below the threshold, no messages will be logged.
- Parameters
level_entry – Message level (from enumerated options).
fmt_string – Log message format string.
... – An arbitrary number of substitution arguments.
-
void log(int level_entry, const char *fmt_string, ...)#
Log a message at the specified level.
If the specified level is below the threshold, no messages will be logged.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
level_entry – Message level (as a non-negative integer).
fmt_string – Log message format string.
... – An arbitrary number of substitution arguments.
-
void debug(const char *fmt_string, ...)#
Emit a debugging-level message.
If the threshold level is higher, no messages will be emitted.
- Parameters
fmt_string – Log message format string.
... – An arbitrary number of substitution arguments.
-
void stat(const char *fmt_string, ...)#
Emit a status-level message.
If the threshold level is higher, no messages will be emitted.
- Parameters
fmt_string – Log message format string.
... – An arbitrary number of substitution arguments.
-
void info(const char *fmt_string, ...)#
Emit a information-level message.
If the threshold level is higher, no messages will be emitted.
- Parameters
fmt_string – Log message format string.
... – An arbitrary number of substitution arguments.
-
void warn(const char *fmt_string, ...)#
Emit a warning-level message.
If the threshold level is higher, no messages will be emitted.
- Parameters
fmt_string – Log message format string.
... – An arbitrary number of substitution arguments.
-
void error(const char *fmt_string, ...)#
Emit a warning-level message.
If the threshold level is higher, no messages will be emitted.
- Parameters
fmt_string – Log message format string.
... – An arbitrary number of substitution arguments.
Public Members
-
int level_limit#
logger threshold level
-
Logger(LogLevel level)#