DiaDes  0.1
DIAgnosis of Discrete-Event System
Loggable.hh
Go to the documentation of this file.
1 #ifndef __DIADES__UTILS__LOGGABLE__HH
2 #define __DIADES__UTILS__LOGGABLE__HH
3 
14 #include "Log.hh"
15 
16 
17 namespace Diades
18 {
19  namespace Utils
20  {
21 
27  class Loggable
28  {
29  private:
31  public:
32 
37  Loggable():_logger(){}
38 
39 
46  Loggable(const string & loggerName):_logger(loggerName){}
47 
48 
55  Loggable(Logger & logger):_logger(logger){}
56 
57 
63  void changeLogger(const string & newLoggerName)
64  {
65  _logger = Logger(newLoggerName);
66  }
67 
68 
74  void changeLogger(Logger & newLogger)
75  {
76  _logger = newLogger;
77  }
78 
79 
80 
89  Diades::Utils::Log log(Log::Level level, const char * msg)
90  {
91 #ifdef __NO__DIADES__LOG
92  return Log();
93 #else
94  return Log(_logger,level,msg);
95 #endif
96  }
97  };
98 
99  };
100 };
101 
102 
103 
104 
105 
106 #endif
Loggable(const string &loggerName)
Definition: Loggable.hh:46
void changeLogger(Logger &newLogger)
Definition: Loggable.hh:74
void changeLogger(const string &newLoggerName)
Definition: Loggable.hh:63
Loggable(Logger &logger)
Definition: Loggable.hh:55
Namespace of the Diades project.
Diades::Utils::Log log(Log::Level level, const char *msg)
Definition: Loggable.hh:89
Logging facilities for the Diades projects.