CppNCorr
C++ ncorr Digital Image Correlation engine
Loading...
Searching...
No Matches
ncorr::log Namespace Reference

Classes

class  Logger
 Process-wide singleton logger. More...
 
class  Stream
 RAII stream builder; flushes its 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 back 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 level_from_string (const std::string &s, Level fallback=Level::Info)
 Parse a level name (case-insensitive): trace, debug, info, warn|warning, error, off.
 
const char * level_name (Level l)
 Short, fixed-width display name for a level (e.g. "INFO ").
 
void set_level (Level l)
 Set the console threshold (convenience wrapper).
 
void set_debug (bool on)
 Lower the console threshold to Debug when on is true (used to honour the engine's existing debug flag).
 
bool set_file (const std::string &path)
 Convenience: open a log file sink (full Debug detail).
 
bool enabled (Level l)
 True if a message at l would be emitted by any sink.
 

Enumeration Type Documentation

◆ Level

enum class ncorr::log::Level
strong

Severity levels, ordered from most to least verbose.

Enumerator
Trace 
Debug 
Info 
Warn 
Error 
Off 

Definition at line 39 of file log.h.

Function Documentation

◆ enabled()

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

True if a message at l would be emitted by any sink.

Definition at line 107 of file log.h.

◆ level_from_string()

Level ncorr::log::level_from_string ( 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 102 of file log.cpp.

◆ level_name()

const char * ncorr::log::level_name ( Level  l)

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

Definition at line 113 of file log.cpp.

◆ set_debug()

void ncorr::log::set_debug ( bool  on)

Lower the console threshold to Debug when on is true (used to honour the engine's existing debug flag).

A no-op when on is false.

Definition at line 239 of file log.cpp.

◆ set_file()

bool ncorr::log::set_file ( const std::string &  path)

Convenience: open a log file sink (full Debug detail).

Definition at line 245 of file log.cpp.

◆ set_level()

void ncorr::log::set_level ( Level  l)

Set the console threshold (convenience wrapper).

Definition at line 235 of file log.cpp.