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 #include "log_event.h"
10 
11 namespace rosmon
12 {
13 
17 class Logger
18 {
19 public:
25  explicit Logger(const std::string& path, bool flush = false);
26  ~Logger();
27 
29  void log(const LogEvent& event);
30 private:
31  FILE* m_file = nullptr;
32  bool m_flush = false;
33 };
34 
35 }
36 
37 #endif
FILE * m_file
Definition: logger.h:31
Logger(const std::string &path, bool flush=false)
Constructor.
Definition: logger.cpp:19
Write log messages into a log file.
Definition: logger.h:17
void log(const LogEvent &event)
Log message.
Definition: logger.cpp:37
bool m_flush
Definition: logger.h:32


rosmon_core
Author(s): Max Schwarz
autogenerated on Sat Jan 9 2021 03:35:43