Conscience Core
Classes | Functions | Variables
conscience_utils::logging Namespace Reference

Classes

class  CscLogger
 
class  CscLoggingConfiguration
 

Functions

const string logLevelToString (LogLevel level)
 
 ENUM (LogLevel, LogLevel_TRACE, LogLevel_DEBUG, LogLevel_INFO, LogLevel_WARN, LogLevel_ERROR, LogLevel_USER)
 

Variables

static string mainLogFilePath = ""
 

Detailed Description

-= How to use =- This logging layer consists of two main classes: CscLoggingConfiguration and CscLogger

CscLogger is the main class: There is a global logging static method (discouraged, roughly here for backward compatibility reasons). The recommended usage is to retrieve a logger per component with for instance CscLogger * myLogger = new CscLogger("ThisIsMine"); You can pass a level threshold: new CscLogger("MyClassOnlyErrors", LogLevel_ERROR). Then use any method of your choice corresponding to your level: myLogger->info("blabla"), myLogger->debug("bliblbi") .. or the general method myLogger->log("blabla", LogLevel_warn)

CscLoggingConfiguration: allows you to set some global logging configuration properties, such as the default logging level.

-= How to setup =- spdlog is required for this logging layer to work some precompilation variable are expected (and cannot be overriden at runtime):

Function Documentation

◆ ENUM()

conscience_utils::logging::ENUM ( LogLevel  ,
LogLevel_TRACE  ,
LogLevel_DEBUG  ,
LogLevel_INFO  ,
LogLevel_WARN  ,
LogLevel_ERROR  ,
LogLevel_USER   
)

◆ logLevelToString()

const string conscience_utils::logging::logLevelToString ( LogLevel  level)

Variable Documentation

◆ mainLogFilePath

string conscience_utils::logging::mainLogFilePath = ""
static