logger.h
Go to the documentation of this file.
1 // Logs all output to a log file for the run
2 // Author: Max Schwarz <max.schwarz@uni-bonn.de>
3 
4 #ifndef LOGGER_H
5 #define LOGGER_H
6 
7 #include <string>
8 
9 namespace rosmon
10 {
11 
15 class Logger
16 {
17 public:
23  explicit Logger(const std::string& path, bool flush = false);
24  ~Logger();
25 
27  void log(const std::string& source, const std::string& msg);
28 private:
29  FILE* m_file = nullptr;
30  bool m_flush = false;
31 };
32 
33 }
34 
35 #endif
FILE * m_file
Definition: logger.h:29
Logger(const std::string &path, bool flush=false)
Constructor.
Definition: logger.cpp:19
Write log messages into a log file.
Definition: logger.h:15
void log(const std::string &source, const std::string &msg)
Log message.
Definition: logger.cpp:37
bool m_flush
Definition: logger.h:30


rosmon_core
Author(s): Max Schwarz
autogenerated on Wed Jul 10 2019 03:10:12