1 #ifndef ERIS_LOG_H
2 #define ERIS_LOG_H
3 
4 #include <sigc++/signal.h>
5 
6 #include <string>
7 
8 namespace Eris
9 {
10 
11 /** Logging level : setting a higher level will automaticaly pull in the lower
12  levels (i.e NOTICE implies ERROR and WARNING) */
13 typedef enum {
14     LOG_ERROR = 0,  ///< serious failure indications
15     LOG_WARNING,    ///< something is amiss, but probably okay to continue
16     LOG_NOTICE,     ///< general information
17     LOG_VERBOSE,    ///< <i>lots</i> of information, about every received operation, for example
18     LOG_DEBUG       ///< excessive amounts of stuff
19 } LogLevel;
20 
21 /// the default logging level for a new connection
22 const LogLevel DEFAULT_LOG = LOG_WARNING;
23 
24 /** Emitted with logging information; client may handle as it see fit.
25 There is room for considerable expansion of this feature; notably message
26 classes (warning / info / debug). Any feedback greatly appreciated */
27 extern sigc::signal<void, LogLevel, const std::string&> Logged;
28 
29 /** set the logging level for all sucessive messages : this can be called at any time, so it is
30 reasonable to bracket suspect calls in setLogLevel calls if you choose */
31 void setLogLevel(LogLevel lvl);
32 
33 LogLevel getLogLevel();
34 
35 }
36 
37 #include <Eris/LogStream.h>
38 
39 #endif
40