CMS 3D CMS Logo

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) ? \
31  cscdqm::LogDebugger(false) : cscdqm::LogDebugger())
32 
33 #endif
34 
35 #ifdef DQMLOCAL
36 
37 #define LOG_DEBUG cscdqm::LogDebugger()
38 
39 #endif
40 
41 #define LOG_ERROR cscdqm::LogError()
42 #define LOG_WARN cscdqm::LogWarn()
43 #define LOG_INFO cscdqm::LogInfo()
44 #define LOG_COUT cscdqm::LogCout()
45 
46 namespace cscdqm {
47 
52  class Logger { };
53 
59  class LogInfo : public edm::LogInfo, public Logger {
60 #ifdef DQMGLOBAL
61  public: LogInfo() : edm::LogInfo("") { }
62 #else
63  public: LogInfo() : edm::LogInfo() { }
64 #endif
65  };
66 
72  class LogWarn : public edm::LogWarning, public Logger {
73 #ifdef DQMGLOBAL
74  public: LogWarn() : edm::LogWarning("") { }
75 #else
76  public: LogWarn() : edm::LogWarning() { }
77 #endif
78  };
79 
85  class LogError : public edm::LogError, public Logger {
86 #ifdef DQMGLOBAL
87  public: LogError() : edm::LogError("") { }
88 #else
89  public: LogError() : edm::LogError() { }
90 #endif
91  };
92 
93 #ifdef DQMGLOBAL
94 
100  class LogDebugger : public edm::LogDebug_, public Logger {
101  public:
102  LogDebugger() : edm::LogDebug_("", __FILE__, __LINE__) { }
103  LogDebugger(const bool empty) : edm::LogDebug_() { }
104  };
105 
106 #endif
107 
108 #ifdef DQMLOCAL
109 
115  class LogDebugger : public edm::LogDebug, public Logger {
116  public:
117  LogDebugger() : edm::LogDebug() { }
118  };
119 
120 #endif
121 
127  class LogCout : public Logger {
128  public:
129 
130  LogCout() { }
131  ~LogCout() { std::cout << std::endl; }
132 
133  template< class T >
134  LogCout& operator<< (T const & t) {
135  std::cout << t;
136  return *this;
137  }
138 
139  LogCout& operator<< (std::ostream&(*f)(std::ostream&)) {
140  std::cout << f;
141  return *this;
142  }
143 
144  LogCout& operator<< (std::ios_base&(*f)(std::ios_base&) ) {
145  std::cout << f;
146  return *this;
147  }
148 
149  };
150 
151 }
152 
153 #endif
#define LogDebug(id)
Information level logger. Use LOG_INFO macros instead, i.e. LOG_INFO << "x = " << x;...
Definition: CSCDQM_Logger.h:59
Error level logger. Use LOG_ERROR macros instead, i.e. LOG_ERROR << "x = " << x;. ...
Definition: CSCDQM_Logger.h:85
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
Simple logger that prints stuff to std::cout. Use LOG_COUT macros instead, i.e. LOG_COUT << "x = " <<...
double f[11][100]
Base Logger Object (empty)
Definition: CSCDQM_Logger.h:52
Warning level logger. Use LOG_WARN macros instead, i.e. LOG_WARN << "x = " << x;. ...
Definition: CSCDQM_Logger.h:72
HLT enums.
long double T