CppNCorr
C++ ncorr Digital Image Correlation engine
Loading...
Searching...
No Matches
log.cpp File Reference

Implementation of the CppNCorr logging facility (see ncorr/log.h). More...

#include "ncorr/log.h"
#include <algorithm>
#include <chrono>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <unistd.h>

Go to the source code of this file.

Namespaces

namespace  ncorr
 
namespace  ncorr::log
 

Macros

#define NCORR_ISATTY(fd)   ::isatty(fd)
 
#define NCORR_FILENO(f)   ::fileno(f)
 

Functions

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.
 
const char * ncorr::log::level_name (Level l)
 Short, fixed-width display name for a level (e.g. "INFO ").
 
void ncorr::log::set_level (Level l)
 Set the console threshold (convenience wrapper).
 
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).
 
bool ncorr::log::set_file (const std::string &path)
 Convenience: open a log file sink (full Debug detail).
 

Detailed Description

Implementation of the CppNCorr logging facility (see ncorr/log.h).

Definition in file log.cpp.

Macro Definition Documentation

◆ NCORR_FILENO

#define NCORR_FILENO (   f)    ::fileno(f)

Definition at line 22 of file log.cpp.

◆ NCORR_ISATTY

#define NCORR_ISATTY (   fd)    ::isatty(fd)

Definition at line 21 of file log.cpp.