|
CPPxDIC
C++ Digital Image Correlation library for fingertip 3D reconstruction
|
Lightweight, dependency-free logging facility for CPPxDIC. More...
#include <fstream>#include <mutex>#include <ostream>#include <sstream>#include <string>Go to the source code of this file.
Classes | |
| class | cppxdic::log::Logger |
| Process-wide singleton logger. More... | |
| struct | cppxdic::log::Options |
| Aggregated options resolved from env/config/CLI, applied in one call. More... | |
| class | cppxdic::log::Stream |
| RAII stream builder; flushes accumulated text to the logger when it is destroyed at the end of the full expression. More... | |
| class | cppxdic::log::Voidify |
| Helper that turns the conditional logging expression into a void statement (glog idiom). More... | |
Namespaces | |
| namespace | cppxdic |
| DataSerializer - Abstract base class for format-agnostic DIC data I/O. | |
| namespace | cppxdic::log |
Macros | |
| #define | LOG_AT(lvl) |
| #define | LOG_TRACE LOG_AT(::cppxdic::log::Level::Trace) |
| #define | LOG_DEBUG LOG_AT(::cppxdic::log::Level::Debug) |
| #define | LOG_INFO LOG_AT(::cppxdic::log::Level::Info) |
| #define | LOG_WARN LOG_AT(::cppxdic::log::Level::Warn) |
| #define | LOG_ERROR LOG_AT(::cppxdic::log::Level::Error) |
Enumerations | |
| enum class | cppxdic::log::Level { cppxdic::log::Trace = 0 , cppxdic::log::Debug = 1 , cppxdic::log::Info = 2 , cppxdic::log::Warn = 3 , cppxdic::log::Error = 4 , cppxdic::log::Off = 5 } |
| Severity levels, ordered from most to least verbose. More... | |
Functions | |
| Level | cppxdic::log::levelFromString (const std::string &s, Level fallback=Level::Info) |
| Parse a level name (case-insensitive): trace, debug, info, warn|warning, error, off. | |
| const char * | cppxdic::log::levelName (Level l) |
| Short, fixed-width display name for a level (e.g. "INFO "). | |
| void | cppxdic::log::configureFromOptions (const Options &opts) |
| Apply env vars, then the supplied options (CLI/config), to the singleton. | |
| void | cppxdic::log::setLevel (Level l) |
| Convenience accessors. | |
| bool | cppxdic::log::setFile (const std::string &path) |
| bool | cppxdic::log::enabled (Level l) |
Lightweight, dependency-free logging facility for CPPxDIC.
Replaces the project's ad-hoc std::cout/std::cerr/printf usage with a single leveled logger. Design goals:
Verbosity vs. debug:
Configuration precedence (low -> high), applied by configureFromOptions():
Definition in file logging.h.
| #define LOG_AT | ( | lvl | ) |
| #define LOG_DEBUG LOG_AT(::cppxdic::log::Level::Debug) |
| #define LOG_ERROR LOG_AT(::cppxdic::log::Level::Error) |
| #define LOG_INFO LOG_AT(::cppxdic::log::Level::Info) |
| #define LOG_TRACE LOG_AT(::cppxdic::log::Level::Trace) |
| #define LOG_WARN LOG_AT(::cppxdic::log::Level::Warn) |