Eris  1.4.0
LogStream.h
1 #ifndef ERIS_LOGSTREAM_H
2 #define ERIS_LOGSTREAM_H
3 
4 #include "Log.h"
5 
6 #include <Atlas/Objects/ObjectsFwd.h>
7 
8 #include <sstream>
9 
10 namespace Atlas {
11  namespace Message {
12  class Element;
13  }
14 }
15 
16 namespace Eris
17 {
18 
19 void doLog(LogLevel lvl, const std::string& msg);
20 
22 {
23 public:
24  std::ostream& operator<<(const std::string& s)
25  {
26  return m_stream << s;
27  }
28 
29 
30 protected:
31 
32  std::ostringstream m_stream;
33 };
34 
35 class notice : public logStreamBase
36 {
37 public:
38  ~notice()
39  {
40  m_stream << std::flush;
41  doLog(LOG_NOTICE, m_stream.str());
42  }
43 };
44 
45 class debug : public logStreamBase
46 {
47 public:
48  ~debug()
49  {
50  m_stream << std::flush;
51  doLog(LOG_DEBUG, m_stream.str());
52  }
53 };
54 
55 class warning : public logStreamBase
56 {
57 public:
58  ~warning()
59  {
60  m_stream << std::flush;
61  doLog(LOG_WARNING, m_stream.str());
62  }
63 };
64 
65 class error : public logStreamBase
66 {
67 public:
68  ~error()
69  {
70  m_stream << std::flush;
71  doLog(LOG_ERROR, m_stream.str());
72  }
73 };
74 
75 std::ostream& operator<<(std::ostream& s, const Atlas::Objects::Root& obj);
76 std::ostream& operator<<(std::ostream& s, const Atlas::Message::Element& msg);
77 
78 } // of namespace Eris
79 
80 #endif
Definition: LogStream.h:55
something is amiss, but probably okay to continue
Definition: Log.h:15
serious failure indications
Definition: Log.h:14
Definition: LogStream.h:45
Every Eris class and type lives inside the Eris namespace; certain utility functions live in the Util...
Definition: Account.cpp:34
Definition: LogStream.h:35
general information
Definition: Log.h:16
Definition: LogStream.h:65
Definition: LogStream.h:21
Definition: BaseConnection.h:18
excessive amounts of stuff
Definition: Log.h:18