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