10 setDescription(
"The logger manager manages all the logging facility whithin the application" ) ;
19 if( config.hasSection(
"logging") ) {
22 streamlog::logsink_list sinks {} ;
24 sinks.push_back( streamlog::logstream::coloredConsole<Logging::mutex_type>() ) ;
27 sinks.push_back( streamlog::logstream::console<Logging::mutex_type>() ) ;
31 sinks.push_back( streamlog::logstream::simpleFile<Logging::mutex_type>( logfilename ) ) ;
35 streamlog::logstream::global().setName(
application().programName() ) ;
36 streamlog::logstream::global().setSinks( sinks ) ;
50 logger->setLevel(
mainLogger()->levelName() ) ;
static Logger createLogger(const std::string &name)
Create a standalone logger instance.
StringParameter _logfile
The name of the log file (optional)
const std::string & name() const
Get the component name.
void setParameters(const ConfigSection §ion, bool throwIfNotFound=false)
Set the parameters from the configuration section.
LoggerPtr _logger
The logger instance.
LoggerManager()
Constructor.
Logger createLogger(const std::string &name) const
Create a new logger instance.
void setDescription(const std::string &desc)
Set the component description.
const Application & application() const
Get the application in which the component is registered.
Logger mainLogger() const
Get the main logger instance (not the global one)
T get() const
Get the parameter value.
BoolParameter _coloredConsole
Whether to use a colored console printout.
void initialize() override
Initialize the logger manager.
const Configuration & configuration() const
Get the main application configuration object.