CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Logger.h
Go to the documentation of this file.
1 #ifndef Logger_h
2 #define Logger_h
3 
5 
6 class Logger {
7 public:
8  Logger(std::string const &name, int debug = 0) : _name(name), _debug(debug) {}
9  Logger() {}
10  virtual ~Logger() {}
11 
12  inline void dqmthrow(std::string const &msg) const { throw cms::Exception("HCALDQM") << _name << "::" << msg; }
13  inline void warn(std::string const &msg) const { edm::LogWarning("HCALDQM") << _name << "::" << msg; }
14  inline void info(std::string const &msg) const {
15  if (_debug == 0)
16  return;
17  edm::LogInfo("HCALDQM") << _name << "::" << msg;
18  }
19  template <typename STDTYPE>
20  inline void debug(STDTYPE const &msg) const {
21  if (_debug == 0)
22  return;
23 
24  std::cout << "%MSG" << std::endl;
25  std::cout << "$MSG-d HCALDQM::" << _name << "::" << msg;
26  std::cout << std::endl;
27  }
28 
29  inline void set(std::string const &name, int debug = 0) {
30  _name = name;
31  _debug = debug;
32 
33  if (debug == 0)
34  return;
35 
36  this->debug("Setting up Logger for " + _name);
37  }
38 
39 protected:
41  int _debug;
42 };
43 
44 #endif
Logger::~Logger
virtual ~Logger()
Definition: Logger.h:10
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::LogInfo
Definition: MessageLogger.h:254
mps_check.msg
tuple msg
Definition: mps_check.py:285
Logger::Logger
Logger(std::string const &name, int debug=0)
Definition: Logger.h:8
HcalCommonHeaders.h
Logger::warn
void warn(std::string const &msg) const
Definition: Logger.h:13
Logger::info
void info(std::string const &msg) const
Definition: Logger.h:14
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
Logger::dqmthrow
void dqmthrow(std::string const &msg) const
Definition: Logger.h:12
Logger::_debug
int _debug
Definition: Logger.h:41
Logger::Logger
Logger()
Definition: Logger.h:9
Exception
Definition: hltDiff.cc:246
Logger
Definition: Logger.h:6
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
Logger::set
void set(std::string const &name, int debug=0)
Definition: Logger.h:29
Logger::debug
void debug(STDTYPE const &msg) const
Definition: Logger.h:20
Logger::_name
std::string _name
Definition: Logger.h:40