CPPxDIC
C++ Digital Image Correlation library for fingertip 3D reconstruction
Loading...
Searching...
No Matches
cppxdic::log Namespace Reference

Classes

class  Logger
 Process-wide singleton logger. More...
 
struct  Options
 Aggregated options resolved from env/config/CLI, applied in one call. More...
 
class  Stream
 RAII stream builder; flushes accumulated text to the logger when it is destroyed at the end of the full expression. More...
 
class  Voidify
 Helper that turns the conditional logging expression into a void statement (glog idiom). More...
 

Enumerations

enum class  Level {
  Trace = 0 , Debug = 1 , Info = 2 , Warn = 3 ,
  Error = 4 , Off = 5
}
 Severity levels, ordered from most to least verbose. More...
 

Functions

Level levelFromString (const std::string &s, Level fallback=Level::Info)
 Parse a level name (case-insensitive): trace, debug, info, warn|warning, error, off.
 
const char * levelName (Level l)
 Short, fixed-width display name for a level (e.g. "INFO ").
 
void configureFromOptions (const Options &opts)
 Apply env vars, then the supplied options (CLI/config), to the singleton.
 
void setLevel (Level l)
 Convenience accessors.
 
bool setFile (const std::string &path)
 
bool enabled (Level l)
 

Enumeration Type Documentation

◆ Level

enum class cppxdic::log::Level
strong

Severity levels, ordered from most to least verbose.

Enumerator
Trace 
Debug 
Info 
Warn 
Error 
Off 

Definition at line 40 of file logging.h.

Function Documentation

◆ configureFromOptions()

void cppxdic::log::configureFromOptions ( const Options &  opts)

Apply env vars, then the supplied options (CLI/config), to the singleton.

Also propagates equivalent settings to the ncorr library via NCORR_LOG_* environment variables so the engine's logs share the same level and file.

Definition at line 233 of file logging.cpp.

◆ enabled()

bool cppxdic::log::enabled ( Level  l)
inline

Definition at line 115 of file logging.h.

◆ levelFromString()

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.

Returns fallback if s is empty or unrecognized.

Definition at line 96 of file logging.cpp.

◆ levelName()

const char * cppxdic::log::levelName ( Level  l)

Short, fixed-width display name for a level (e.g. "INFO ").

Definition at line 107 of file logging.cpp.

◆ setFile()

bool cppxdic::log::setFile ( const std::string &  path)

Definition at line 229 of file logging.cpp.

◆ setLevel()

void cppxdic::log::setLevel ( Level  l)

Convenience accessors.

Definition at line 225 of file logging.cpp.