CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CSCDQM_Logger.h
Go to the documentation of this file.
1 /*
2  * =====================================================================================
3  *
4  * Filename: CSCDQM_Logger.h
5  *
6  * Description: Histo Provider to EventProcessor
7  *
8  * Version: 1.0
9  * Created: 10/03/2008 10:26:04 AM
10  * Revision: none
11  * Compiler: gcc
12  *
13  * Author: Valdas Rapsevicius, valdas.rapsevicius@cern.ch
14  * Company: CERN, CH
15  *
16  * =====================================================================================
17  */
18 
19 #ifndef CSCDQM_Logger_H
20 #define CSCDQM_Logger_H
21 
22 #include <iostream>
23 #include <iomanip>
24 //#include <typeinfo> typeid(this).name()
25 
27 
28 #ifdef DQMGLOBAL
29 
30 #define LOG_DEBUG ((!edm::MessageDrop::instance()->debugEnabled) ? cscdqm::LogDebugger(false) : cscdqm::LogDebugger())
31 
32 #endif
33 
34 #ifdef DQMLOCAL
35 
36 #define LOG_DEBUG cscdqm::LogDebugger()
37 
38 #endif
39 
40 #define LOG_ERROR cscdqm::LogError()
41 #define LOG_WARN cscdqm::LogWarn()
42 #define LOG_INFO cscdqm::LogInfo()
43 #define LOG_COUT cscdqm::LogCout()
44 
45 namespace cscdqm {
46 
51  class Logger {};
52 
58  class LogInfo : public edm::LogInfo, public Logger {
59 #ifdef DQMGLOBAL
60  public:
61  LogInfo() : edm::LogInfo("") {}
62 #else
63  public:
64  LogInfo() : edm::LogInfo() {}
65 #endif
66  };
67 
73  class LogWarn : public edm::LogWarning, public Logger {
74 #ifdef DQMGLOBAL
75  public:
76  LogWarn() : edm::LogWarning("") {}
77 #else
78  public:
79  LogWarn() : edm::LogWarning() {}
80 #endif
81  };
82 
88  class LogError : public edm::LogError, public Logger {
89 #ifdef DQMGLOBAL
90  public:
91  LogError() : edm::LogError("") {}
92 #else
93  public:
94  LogError() : edm::LogError() {}
95 #endif
96  };
97 
98 #ifdef DQMGLOBAL
99 
105  class LogDebugger : public edm::LogDebug_, public Logger {
106  public:
107  LogDebugger() : edm::LogDebug_("", __FILE__, __LINE__) {}
108  LogDebugger(const bool empty) : edm::LogDebug_() {}
109  };
110 
111 #endif
112 
113 #ifdef DQMLOCAL
114 
120  class LogDebugger : public edm::LogDebug, public Logger {
121  public:
122  LogDebugger() : edm::LogDebug() {}
123  };
124 
125 #endif
126 
132  class LogCout : public Logger {
133  public:
134  LogCout() {}
135  ~LogCout() { std::cout << std::endl; }
136 
137  template <class T>
138  LogCout& operator<<(T const& t) {
139  std::cout << t;
140  return *this;
141  }
142 
143  LogCout& operator<<(std::ostream& (*f)(std::ostream&)) {
144  std::cout << f;
145  return *this;
146  }
147 
148  LogCout& operator<<(std::ios_base& (*f)(std::ios_base&)) {
149  std::cout << f;
150  return *this;
151  }
152  };
153 
154 } // namespace cscdqm
155 
156 #endif
Definition: Logger.h:6
LogCout & operator<<(std::ostream &(*f)(std::ostream &))
Information level logger. Use LOG_INFO macros instead, i.e. LOG_INFO &lt;&lt; &quot;x = &quot; &lt;&lt; x;...
Definition: CSCDQM_Logger.h:58
Error level logger. Use LOG_ERROR macros instead, i.e. LOG_ERROR &lt;&lt; &quot;x = &quot; &lt;&lt; x;. ...
Definition: CSCDQM_Logger.h:88
Log< level::Error, false > LogError
Simple logger that prints stuff to std::cout. Use LOG_COUT macros instead, i.e. LOG_COUT &lt;&lt; &quot;x = &quot; &lt;&lt;...
Log< level::Info, false > LogInfo
Base Logger Object (empty)
Definition: CSCDQM_Logger.h:51
Warning level logger. Use LOG_WARN macros instead, i.e. LOG_WARN &lt;&lt; &quot;x = &quot; &lt;&lt; x;. ...
Definition: CSCDQM_Logger.h:73
LogCout & operator<<(T const &t)
tuple cout
Definition: gather_cfg.py:144
Log< level::Warning, false > LogWarning
LogCout & operator<<(std::ios_base &(*f)(std::ios_base &))
long double T
#define LogDebug(id)