EEROS  0.4.1.0
API for the EEROS Real-Time Robotics Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
LogEntry.hpp
Go to the documentation of this file.
1 #ifndef ORG_EEROS_LOGGER_LOGENTRY_HPP_
2 #define ORG_EEROS_LOGGER_LOGENTRY_HPP_
3 
4 namespace eeros {
5  namespace logger {
6  template < typename TWriter >
7  class LogEntry {
8  public:
9  LogEntry(TWriter* writer, unsigned level, unsigned category = 0) : w(writer) {
10  if(w != nullptr) w->begin(level, category);
11  }
12 
14  if(w != nullptr) w->end();
15  }
16 
17  template < typename T >
19  if(w != nullptr) (*w) << value;
20  return *this;
21  }
22 
23  TWriter* w;
24  };
25  }
26 }
27 
28 #endif /* ORG_EEROS_LOGGER_LOGENTRY_HPP_ */
TWriter * w
Definition: LogEntry.hpp:23
~LogEntry()
Definition: LogEntry.hpp:13
LogEntry(TWriter *writer, unsigned level, unsigned category=0)
Definition: LogEntry.hpp:9
LogEntry< TWriter > & operator<<(T value)
Definition: LogEntry.hpp:18
Definition: LogEntry.hpp:7