|
CPPxDIC
C++ Digital Image Correlation library for fingertip 3D reconstruction
|
Process-wide singleton logger. More...
#include <logging.h>
Public Member Functions | |
| void | setConsoleLevel (Level l) |
| void | setFileLevel (Level l) |
| Level | consoleLevel () const |
| Level | fileLevel () const |
| bool | setFile (const std::string &path) |
| Open (or replace) the file sink. | |
| void | setConsoleEnabled (bool on) |
| Enable or disable console output entirely. | |
| void | setVerboseFormat (bool on) |
| Include timestamp + source location in console output too (the file sink always includes them). | |
| void | configureFromEnv () |
| Apply CPPXDIC_LOG_LEVEL / CPPXDIC_LOG_FILE / CPPXDIC_LOG_CONSOLE. | |
| bool | enabled (Level l) |
True if a message at l would reach any sink. | |
| void | write (Level l, const char *file, int line, const std::string &msg) |
Emit a fully-formed message (trailing newlines trimmed) at l. | |
Static Public Member Functions | |
| static Logger & | instance () |
Process-wide singleton logger.
All members are thread-safe.
| void cppxdic::log::Logger::configureFromEnv | ( | ) |
Apply CPPXDIC_LOG_LEVEL / CPPXDIC_LOG_FILE / CPPXDIC_LOG_CONSOLE.
Runs once automatically on first use; calling again re-applies them.
Definition at line 141 of file logging.cpp.
| Level cppxdic::log::Logger::consoleLevel | ( | ) | const |
Definition at line 164 of file logging.cpp.
| bool cppxdic::log::Logger::enabled | ( | Level | l | ) |
True if a message at l would reach any sink.
Use to guard expensive message construction in hot loops.
Definition at line 192 of file logging.cpp.
| Level cppxdic::log::Logger::fileLevel | ( | ) | const |
Definition at line 169 of file logging.cpp.
|
static |
Definition at line 125 of file logging.cpp.
| void cppxdic::log::Logger::setConsoleEnabled | ( | bool | on | ) |
Enable or disable console output entirely.
Definition at line 182 of file logging.cpp.
| void cppxdic::log::Logger::setConsoleLevel | ( | Level | l | ) |
Definition at line 154 of file logging.cpp.
| bool cppxdic::log::Logger::setFile | ( | const std::string & | path | ) |
Open (or replace) the file sink.
An empty path closes the file sink.
path could not be opened (file sink left closed). Definition at line 174 of file logging.cpp.
| void cppxdic::log::Logger::setFileLevel | ( | Level | l | ) |
Definition at line 159 of file logging.cpp.
| void cppxdic::log::Logger::setVerboseFormat | ( | bool | on | ) |
Include timestamp + source location in console output too (the file sink always includes them).
Off by default to keep the console readable.
Definition at line 187 of file logging.cpp.
| void cppxdic::log::Logger::write | ( | Level | l, |
| const char * | file, | ||
| int | line, | ||
| const std::string & | msg | ||
| ) |
Emit a fully-formed message (trailing newlines trimmed) at l.
Definition at line 201 of file logging.cpp.