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) ? 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:
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
cscdqm::LogCout
Simple logger that prints stuff to std::cout. Use LOG_COUT macros instead, i.e. LOG_COUT << "x = " <<...
Definition: CSCDQM_Logger.h:132
MessageLogger.h
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
cscdqm::LogError
Error level logger. Use LOG_ERROR macros instead, i.e. LOG_ERROR << "x = " << x;.
Definition: CSCDQM_Logger.h:88
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::LogDebug_
Definition: MessageLogger.h:138
gather_cfg.cout
cout
Definition: gather_cfg.py:144
cscdqm::LogCout::operator<<
LogCout & operator<<(std::ostream &(*f)(std::ostream &))
Definition: CSCDQM_Logger.h:143
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
cscdqm::LogError::LogError
LogError()
Definition: CSCDQM_Logger.h:94
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
cscdqm::LogWarn
Warning level logger. Use LOG_WARN macros instead, i.e. LOG_WARN << "x = " << x;.
Definition: CSCDQM_Logger.h:73
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
cscdqm
Definition: CSCDQM_DCSBase.h:29
cscdqm::LogInfo
Information level logger. Use LOG_INFO macros instead, i.e. LOG_INFO << "x = " << x;.
Definition: CSCDQM_Logger.h:58
cscdqm::LogWarn::LogWarn
LogWarn()
Definition: CSCDQM_Logger.h:79
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
cscdqm::LogInfo::LogInfo
LogInfo()
Definition: CSCDQM_Logger.h:64
cscdqm::LogCout::operator<<
LogCout & operator<<(T const &t)
Definition: CSCDQM_Logger.h:138
T
long double T
Definition: Basic3DVectorLD.h:48
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
cscdqm::Logger
Base Logger Object (empty)
Definition: CSCDQM_Logger.h:51
Logger
Definition: Logger.h:6
cscdqm::LogCout::~LogCout
~LogCout()
Definition: CSCDQM_Logger.h:135
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::Log
Definition: MessageLogger.h:70
cscdqm::LogCout::LogCout
LogCout()
Definition: CSCDQM_Logger.h:134
cscdqm::LogCout::operator<<
LogCout & operator<<(std::ios_base &(*f)(std::ios_base &))
Definition: CSCDQM_Logger.h:148