chemfiles::Logger
The Logger class is a singleton class providing logging facilities.
Public Type
Where the log message should go.
Values:
SILENT
- Do not log anything.
STDOUT
- Log to stdout.
STDERR
- Log to stderr.
FILE
- Log to a file.
CALLBACK
- Log to the C callback.
Public Static Functions
log
(LogLevel level, Args const &... args)Log a message
if the level
is lower than the maximal curent logging level. The message can be built using a variadic function call, like: ```cxx Logger::log(LogLevel::ERROR, “Here ”, ” and ”, 4, ” times ”, there->call()); ```
error
(Args const &... args)Equivalent to Logger::log(LogLevel::ERROR, args...)
warn
(Args const &... args)Equivalent to Logger::log(LogLevel::ERROR, args...)
info
(Args const &... args)Equivalent to Logger::log(LogLevel::ERROR, args...)
debug
(Args const &... args)Equivalent to Logger::log(LogLevel::ERROR, args...)
set_level
(LogLevel level)Set the logging level.
level
()Get the current logging level.
to_stdout
()Make the logger output to stdout.
to_stderr
()Make the logger output to stderr.
silent
()Silent the logger.
to_file
(const std::string & path)Make the logger output to the file at path
. The file will be created and overwrited if it already exists.
callback
(logging_cb_t function)Set a callback that will be called to perform logging.
backend
()Get the current logging backend.