-= 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):
- CSC_LOG_DIR, which defaults to /var/log/conscience
- CSC_LOG_MAIN_FILENAME to be defined to something like myNiceApp_version.log OR call CscLoggingConfiguration::getInstance()->setMainFileName("my.log")
- CSC_LOG_ENABLE_STDOUT to also log to stdout