EEROS  0.4.1.0
API for the EEROS Real-Time Robotics Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
StreamLogWriter.hpp
Go to the documentation of this file.
1 #ifndef ORG_EEROS_LOGGER_STREAMLOGWRITER_HPP_
2 #define ORG_EEROS_LOGGER_STREAMLOGWRITER_HPP_
3 
5 #include <ostream>
6 #include <mutex>
7 
8 namespace eeros
9 {
10  namespace logger
11  {
12  class StreamLogWriter : public LogWriter
13  {
14  public:
15  StreamLogWriter(std::ostream& out);
16 
17  virtual void show(unsigned level = ~0);
18 
19  virtual void begin(unsigned level, unsigned category);
20  virtual void end();
21 
22  virtual void endl();
23 
24  virtual LogWriter& operator<<(int value);
25  virtual LogWriter& operator<<(unsigned int value);
26  virtual LogWriter& operator<<(long value);
27  virtual LogWriter& operator<<(double value);
28  virtual LogWriter& operator<<(const std::string& value);
29  virtual LogWriter& operator<<(std::ostream& os);
30  virtual LogWriter& operator<<(void (*f)(LogWriter&));
31 
32  private:
33  std::mutex mtx;
34  std::ostream& out;
35  unsigned visible_level;
36  bool enabled;
37  bool colored;
38  };
39  }
40 }
41 
42 #endif /* ORG_EEROS_LOGGER_STREAMLOGWRITER_HPP_ */
virtual LogWriter & operator<<(int value)
Definition: StreamLogWriter.cpp:98
virtual void endl()
Definition: StreamLogWriter.cpp:93
virtual void show(unsigned level=~0)
Definition: StreamLogWriter.cpp:34
StreamLogWriter(std::ostream &out)
Definition: StreamLogWriter.cpp:25
virtual void end()
Definition: StreamLogWriter.cpp:86
Definition: LogWriter.hpp:11
virtual void begin(unsigned level, unsigned category)
Definition: StreamLogWriter.cpp:36
Definition: StreamLogWriter.hpp:12