CMS 3D CMS Logo

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