MarlinMT  0.1.0
LoggerManager.h
Go to the documentation of this file.
1 #ifndef MARLINMT_LOGGERMANAGER_h
2 #define MARLINMT_LOGGERMANAGER_h 1
3 
4 // -- std headers
5 #include <string>
6 
7 // -- marlinmt headers
8 #include <marlinmt/Exceptions.h>
9 #include <marlinmt/Logging.h>
10 #include <marlinmt/Component.h>
11 
12 namespace marlinmt {
13 
14  class Application ;
15 
21  class LoggerManager : public Component {
22  public:
24 
25  public:
26  LoggerManager(const LoggerManager &) = delete ;
27  LoggerManager& operator=(const LoggerManager &) = delete ;
28  ~LoggerManager() = default ;
29 
33  LoggerManager() ;
34 
38  void initialize() override ;
39 
43  Logger mainLogger() const ;
44 
51  Logger createLogger( const std::string &name ) const ;
52 
53  private:
55  StringParameter _logfile {*this, "Logfile", "The name of the log file", "" } ;
57  BoolParameter _coloredConsole {*this, "ColoredConsole", "Whether to use a colored console printout", false } ;
58  };
59 
60 } // end namespace marlinmt
61 
62 #endif
LoggerManager & operator=(const LoggerManager &)=delete
StringParameter _logfile
The name of the log file (optional)
Definition: LoggerManager.h:55
const std::string & name() const
Get the component name.
Definition: Component.cc:23
LoggerManager()
Constructor.
Definition: LoggerManager.cc:8
Logger createLogger(const std::string &name) const
Create a new logger instance.
Component class.
Definition: Component.h:22
Logging::Logger Logger
Definition: LoggerManager.h:23
Logger mainLogger() const
Get the main logger instance (not the global one)
BoolParameter _coloredConsole
Whether to use a colored console printout.
Definition: LoggerManager.h:57
std::shared_ptr< streamlog::logstreamT< mutex_type > > Logger
Definition: Logging.h:73
void initialize() override
Initialize the logger manager.
LoggerManager class Responsible for configuring logger for a given application.
Definition: LoggerManager.h:21