MachineIntelligenceCore:Toolchain
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
LoggerOutput.hpp
Go to the documentation of this file.
1 
23 #ifndef SRC_CONFIGURATION_LOGGEROUTPUT_HPP_
24 #define SRC_CONFIGURATION_LOGGEROUTPUT_HPP_
25 
26 #include <logger/LoggerAux.hpp>
27 
28 
29 namespace mic {
30 namespace logger {
31 
36 class LoggerOutput {
37 public:
43  {
44 
45  }
46 
50  virtual ~LoggerOutput(){}
51 
52 
62  virtual void print(const std::string & msg_, Severity_t severity_, const std::string & file_, int line_) const = 0;
63 
68  void setLvl(Severity_t sev) {
69  lvl = sev;
70  }
71 
75  void incrementLvl() {
76  if (lvl < LFATAL)
77  lvl = (Severity_t)(lvl+1);
78  }
79 
83  void decrementLvl() {
84  if (lvl > LTRACE)
85  lvl = (Severity_t)(lvl-1);
86  }
87 
88 
93  Severity_t getLvl() const {
94  return lvl;
95  }
96 
97 protected:
102 };
103 
104 
105 
106 } /* namespace logger */
107 } /* namespace mic */
108 
109 
110 #endif /* SRC_CONFIGURATION_LOGGEROUTPUT_HPP_ */
Severity_t
Message severity level.
Definition: LoggerAux.hpp:35
#define LINFO
Definition: LoggerAux.hpp:55
Severity_t getLvl() const
#define LTRACE
Definition: LoggerAux.hpp:52
#define LFATAL
Definition: LoggerAux.hpp:59
void setLvl(Severity_t sev)
Abstract interface for different logger outputs.
Contains declarations of logger auxiliary functions, macros and severity type.
virtual void print(const std::string &msg_, Severity_t severity_, const std::string &file_, int line_) const =0
Logs given message. Depending on actual implementation, it can be printed on terminal, ncurses window, file etc.
LoggerOutput(Severity_t sev=LINFO)