CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MessageLogger.cc
Go to the documentation of this file.
3 
4 // Change Log
5 //
6 // 12/12/07 mf elimination of dummyLogDebugObject_, dummyLogTraceObject_
7 // (see change log 8 in MessageLogger.h)
8 //
9 // 12/14/07 mf Moved the static free function onlyLowestDirectory
10 // to a class member function of LogDebug_, changing
11 // name to a more descriptive stripLeadingDirectoryTree.
12 // Cures the 2600-copies-of-this-function complaint.
13 // Implementation of this is moved into this .cc file.
14 //
15 // 6/20/08 mf Have flushMessageLog() check messageLoggerScribeIsRunning
16 // (in the message drop) to avoid hangs if that thread is not
17 // around.
18 //
19 // 11/18/08 wmtan Use explicit non-inlined destructors
20 //
21 // 8/11/09 mf setStandAloneMessageThreshold() and
22 // squelchStandAloneMessageCategory()
23 //
24 // 10/29/09 wmtan Use explicit non-inlined constructors for LogDebug_
25 // and LogTrace_
26 //
27 // 8/11/09 mf setStandAloneMessageThreshold() and
28 // squelchStandAloneMessageCategory()
29 //
30 // 9/23/10 mf Initialize debugEnabled according to
31 // MessageDrop::debugAlwaysSuppressed, rather than
32 // just true. See change 21 of MessageLogger.h.
33 //
34 // 9/27/10 mf isDebugEnabled() - check that debugAlwaysSuppressed is
35 // false before examining debugEnabled, which in principle
36 // ought to be thread-specific thus more expensive to look at.
37 //
38 // 9/27/10b mf dtor for LogWarningThatSuppressesLikeLogInfo - see
39 // change log 22 in MessageLogger.h
40 //
41 // 11/30/10 mf SnapshotMessageLog() method to force MessageDrop to capture any
42 // pointed-to strings in anticipation of key objects going
43 // away before a message is going to be issued.
44 //
45 //
46 // 7/6/11 fwyzard Add support for discarding LogError-level messages
47 // on a per-module basis (needed at HLT)
48 // ------------------------------------------------------------------------
49 
50 namespace edm {
51 
63 namespace edmmltest { // 9/27/10b mf
65 }
66 
67 void LogStatistics() {
68  edm::MessageLoggerQ::MLqSUM ( ); // trigger summary info
69 }
70 
72  return ((!edm::MessageDrop::debugAlwaysSuppressed) // 9/27/10 mf
73  && edm::MessageDrop::instance()->debugEnabled );
74 }
75 
76 bool isInfoEnabled() {
77  return ((!edm::MessageDrop::infoAlwaysSuppressed) // 9/27/10 mf
78  && edm::MessageDrop::instance()->infoEnabled );
79 }
80 
82  return ((!edm::MessageDrop::warningAlwaysSuppressed) // 9/27/10 mf
83  && edm::MessageDrop::instance()->warningEnabled );
84 }
85 
87  return edm::MessageDrop::instance()->errorEnabled; // 7/6/11 fwyzard
88 }
89 
91  edm::MessageLoggerQ::MLqSHT ( ); // Shut the logger up
92 }
93 
95  if (MessageDrop::instance()->messageLoggerScribeIsRunning !=
96  MLSCRIBE_RUNNING_INDICATOR) return; // 6/20/08 mf
97  edm::MessageLoggerQ::MLqFLS ( ); // Flush the message log queue
98 }
99 
100 void clearMessageLog() { // 11/30/10 mf
102 }
103 
104 bool isMessageProcessingSetUp() { // 6/20/08 mf
105 // std::cerr << "isMessageProcessingSetUp: \n";
106 // std::cerr << "messageLoggerScribeIsRunning = "
107 // << (int)MessageDrop::instance()->messageLoggerScribeIsRunning << "\n";
108  return (MessageDrop::instance()->messageLoggerScribeIsRunning ==
110 }
111 
113  std::string * cat_p = new std::string(category);
114  edm::MessageLoggerQ::MLqGRP (cat_p); // Indicate a group summary category
115  // Note that the scribe will be responsible for deleting cat_p
116 }
117 
119  : ap( ELdebug,id)
120 {
121  *this
122  << " "
124  << ":" << line << "\n";
125 }
126 
129  std::string::size_type lastSlash = file.find_last_of('/');
130  if (lastSlash == std::string::npos) return file;
131  if (lastSlash == file.size()-1) return file;
132  return file.substr(lastSlash+1, file.size()-lastSlash-1);
133 }
134 
136  : ap( ELdebug,id,true)
137  { }
138 
141 }
144 }
145 
146 } // namespace edm
ELslProxy< ELdebugGen > const ELdebug
bool isDebugEnabled()
bool isWarningEnabled()
void FlushMessageLog()
void HaltMessageLogging()
static MessageDrop * instance()
Definition: MessageDrop.cc:60
bool isMessageProcessingSetUp()
bool isErrorEnabled()
uint16_t size_type
static const unsigned char MLSCRIBE_RUNNING_INDICATOR
Definition: MessageDrop.h:121
void setStandAloneMessageThreshold(edm::ELseverityLevel const &severity)
static bool debugAlwaysSuppressed
Definition: MessageDrop.h:111
static void squelch(std::string const &category)
void GroupLogStatistics(std::string const &category)
static void MLqFLS()
void squelchStandAloneMessageCategory(std::string const &category)
static bool warningAlwaysSuppressed
Definition: MessageDrop.h:113
void LogStatistics()
void clearMessageLog()
static void MLqGRP(std::string *cat_p)
bool isInfoEnabled()
static void standAloneThreshold(edm::ELseverityLevel const &severity)
static void MLqSUM()
static bool infoAlwaysSuppressed
Definition: MessageDrop.h:112
std::string stripLeadingDirectoryTree(const std::string &file) const
static void MLqSHT()