MarlinMT  0.1.0
Logging.h
Go to the documentation of this file.
1 #ifndef MARLINMT_LOGGING_h
2 #define MARLINMT_LOGGING_h
3 
4 // -- streamlog headers
5 #include <streamlog/streamlog.h>
6 
7 namespace marlinmt {
8 
9  namespace loglevel {
10 
11  // import the log level classes into the marlinmt namespace
12  using streamlog::DEBUG ;
13  using streamlog::DEBUG0 ;
14  using streamlog::DEBUG1 ;
15  using streamlog::DEBUG2 ;
16  using streamlog::DEBUG3 ;
17  using streamlog::DEBUG4 ;
18  using streamlog::DEBUG5 ;
19  using streamlog::DEBUG6 ;
20  using streamlog::DEBUG7 ;
21  using streamlog::DEBUG8 ;
22  using streamlog::DEBUG9 ;
23  using streamlog::MESSAGE ;
24  using streamlog::MESSAGE0 ;
25  using streamlog::MESSAGE1 ;
26  using streamlog::MESSAGE2 ;
27  using streamlog::MESSAGE3 ;
28  using streamlog::MESSAGE4 ;
29  using streamlog::MESSAGE5 ;
30  using streamlog::MESSAGE6 ;
31  using streamlog::MESSAGE7 ;
32  using streamlog::MESSAGE8 ;
33  using streamlog::MESSAGE9 ;
34  using streamlog::WARNING ;
35  using streamlog::WARNING0 ;
36  using streamlog::WARNING1 ;
37  using streamlog::WARNING2 ;
38  using streamlog::WARNING3 ;
39  using streamlog::WARNING4 ;
40  using streamlog::WARNING5 ;
41  using streamlog::WARNING6 ;
42  using streamlog::WARNING7 ;
43  using streamlog::WARNING8 ;
44  using streamlog::WARNING9 ;
45  using streamlog::ERROR ;
46  using streamlog::ERROR0 ;
47  using streamlog::ERROR1 ;
48  using streamlog::ERROR2 ;
49  using streamlog::ERROR3 ;
50  using streamlog::ERROR4 ;
51  using streamlog::ERROR5 ;
52  using streamlog::ERROR6 ;
53  using streamlog::ERROR7 ;
54  using streamlog::ERROR8 ;
55  using streamlog::ERROR9 ;
56  using streamlog::SILENT ;
57  }
58 
59  using namespace loglevel ;
60 
66  class Logging {
67  public:
68 #ifdef MARLINMT_LOGGER_TS
69  using mutex_type = streamlog::mt ;
70 #else
71  using mutex_type = streamlog::st ;
72 #endif
73  using Logger = std::shared_ptr<streamlog::logstreamT<mutex_type>> ;
74  using StreamType = Logger::element_type::stream_type ;
75  using DefaultLoggerType = streamlog::logstream::default_logger_type ;
76 
77  public:
83  static Logger createLogger( const std::string &name ) ;
84 
88  static DefaultLoggerType &globalLogger() ;
89  };
90 
91 }
92 
93 #endif
streamlog::st mutex_type
Definition: Logging.h:71
Logger::element_type::stream_type StreamType
Definition: Logging.h:74
Logging class.
Definition: Logging.h:66
std::shared_ptr< streamlog::logstreamT< mutex_type > > Logger
Definition: Logging.h:73
streamlog::logstream::default_logger_type DefaultLoggerType
Definition: Logging.h:75