CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Static Private Attributes
edm::MessageLoggerQ Class Reference

#include <MessageLoggerQ.h>

Public Types

enum  OpCode {
  END_THREAD, LOG_A_MESSAGE, CONFIGURE, EXTERN_DEST,
  SUMMARIZE, JOBMODE, SHUT_UP, FLUSH_LOG_Q,
  GROUP_STATS, FJR_SUMMARY
}
 

Static Public Member Functions

static bool handshaked (const OpCode &op)
 
static bool ignore (edm::ELseverityLevel const &severity, std::string const &category)
 
static MessageLoggerQinstance ()
 
static void MLqCFG (ParameterSet *p)
 
static void MLqEND ()
 
static void MLqEXT (service::NamedDestination *p)
 
static void MLqFLS ()
 
static void MLqGRP (std::string *cat_p)
 
static void MLqJRS (std::map< std::string, double > *sum_p)
 
static void MLqLOG (ErrorObj *p)
 
static void MLqMOD (std::string *jm)
 
static void MLqSHT ()
 
static void MLqSUM ()
 
static void setMLscribe_ptr (std::shared_ptr< edm::service::AbstractMLscribe > m)
 
static void squelch (std::string const &category)
 
static void standAloneThreshold (edm::ELseverityLevel const &severity)
 

Private Member Functions

 MessageLoggerQ ()
 
 MessageLoggerQ (MessageLoggerQ const &)
 
void operator= (MessageLoggerQ const &)
 
 ~MessageLoggerQ ()
 

Static Private Member Functions

static void handshakedCommand (OpCode opcode, void *operand, std::string const &commandMnemonic)
 
static void simpleCommand (OpCode opcode, void *operand)
 

Static Private Attributes

static std::shared_ptr
< edm::service::AbstractMLscribe
mlscribe_ptr = obtainStandAloneScribePtr()
 
static std::set< std::string > squelchSet
 
static edm::ELseverityLevel threshold
 

Detailed Description

Definition at line 25 of file MessageLoggerQ.h.

Member Enumeration Documentation

Enumerator
END_THREAD 
LOG_A_MESSAGE 
CONFIGURE 
EXTERN_DEST 
SUMMARIZE 
JOBMODE 
SHUT_UP 
FLUSH_LOG_Q 
GROUP_STATS 
FJR_SUMMARY 

Definition at line 29 of file MessageLoggerQ.h.

Constructor & Destructor Documentation

MessageLoggerQ::MessageLoggerQ ( )
private

Definition at line 122 of file MessageLoggerQ.cc.

123 { }
MessageLoggerQ::~MessageLoggerQ ( )
private

Definition at line 126 of file MessageLoggerQ.cc.

127 { }
edm::MessageLoggerQ::MessageLoggerQ ( MessageLoggerQ const &  )
private

Member Function Documentation

bool MessageLoggerQ::handshaked ( const OpCode op)
static

Definition at line 243 of file MessageLoggerQ.cc.

References CONFIGURE, FJR_SUMMARY, and FLUSH_LOG_Q.

Referenced by edm::service::MainThreadMLscribe::runCommand().

244 {
245  return ( (op == CONFIGURE) || (op == FLUSH_LOG_Q) || (op == FJR_SUMMARY) );
246 } // MessageLoggerQ::handshaked(op)
void MessageLoggerQ::handshakedCommand ( OpCode  opcode,
void *  operand,
std::string const &  commandMnemonic 
)
staticprivate

Definition at line 155 of file MessageLoggerQ.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, mlscribe_ptr, and cms::Exception::what().

Referenced by MLqCFG(), MLqFLS(), and MLqJRS().

159 { // Change Log 10
160  try {
161  mlscribe_ptr->runCommand(opcode, operand);
162  }
163  catch(edm::Exception& ex)
164  {
165  ex << "\n The preceding exception was thrown in MessageLoggerScribe\n";
166  ex << "and forwarded to the main thread from the Messages thread.";
167  std::cerr << "exception from MessageLoggerQ::"
168  << commandMnemonic << " - exception what() is \n"
169  << ex.what();
170  // TODO - get the above text into the what itself
171  throw ex;
172  }
173 } // handshakedCommand
virtual char const * what() const
Definition: Exception.cc:141
static std::shared_ptr< edm::service::AbstractMLscribe > mlscribe_ptr
bool MessageLoggerQ::ignore ( edm::ELseverityLevel const &  severity,
std::string const &  category 
)
static

Definition at line 257 of file MessageLoggerQ.cc.

References squelchSet, and threshold.

258  {
259  if ( severity < threshold ) return true;
260  if ( squelchSet.count(category) > 0 ) return true;
261  return false;
262 }
static edm::ELseverityLevel threshold
static std::set< std::string > squelchSet
MessageLoggerQ * MessageLoggerQ::instance ( )
static

Definition at line 131 of file MessageLoggerQ.cc.

References mps_fire::queue.

132 {
133  [[cms::thread_safe]] static MessageLoggerQ queue;
134  return &queue;
135 } // MessageLoggerQ::instance()
void MessageLoggerQ::MLqCFG ( ParameterSet p)
static

Definition at line 195 of file MessageLoggerQ.cc.

References CONFIGURE, and handshakedCommand().

Referenced by edm::service::MessageLogger::MessageLogger().

196 {
197  handshakedCommand(CONFIGURE, p, "CFG" );
198 } // MessageLoggerQ::CFG()
static void handshakedCommand(OpCode opcode, void *operand, std::string const &commandMnemonic)
void MessageLoggerQ::MLqEND ( )
static

Definition at line 176 of file MessageLoggerQ.cc.

References END_THREAD, and simpleCommand().

Referenced by run_app(), edm::service::MessageServicePresence::~MessageServicePresence(), and edm::service::SingleThreadMSPresence::~SingleThreadMSPresence().

177 {
178  simpleCommand (END_THREAD, (void *)0);
179 } // MessageLoggerQ::END()
static void simpleCommand(OpCode opcode, void *operand)
void MessageLoggerQ::MLqEXT ( service::NamedDestination p)
static

Definition at line 201 of file MessageLoggerQ.cc.

References EXTERN_DEST, and simpleCommand().

202 {
203  simpleCommand (EXTERN_DEST, static_cast<void *>(p));
204 }
static void simpleCommand(OpCode opcode, void *operand)
void MessageLoggerQ::MLqFLS ( )
static

Definition at line 220 of file MessageLoggerQ.cc.

References FLUSH_LOG_Q, and handshakedCommand().

Referenced by edm::FlushMessageLog().

221 {
222  // The ConfigurationHandshake, developed for synchronous CFG, contains a
223  // place to convey exception information. FLS does not need this, nor does
224  // it need the parameter set, but we are reusing ConfigurationHandshake
225  // rather than reinventing the mechanism.
226  handshakedCommand(FLUSH_LOG_Q, 0, "FLS" );
227 } // MessageLoggerQ::FLS()
static void handshakedCommand(OpCode opcode, void *operand, std::string const &commandMnemonic)
void MessageLoggerQ::MLqGRP ( std::string *  cat_p)
static

Definition at line 230 of file MessageLoggerQ.cc.

References GROUP_STATS, and simpleCommand().

Referenced by edm::GroupLogStatistics().

231 {
232  simpleCommand (GROUP_STATS, static_cast<void *>(cat_p));
233 } // MessageLoggerQ::GRP()
static void simpleCommand(OpCode opcode, void *operand)
void MessageLoggerQ::MLqJRS ( std::map< std::string, double > *  sum_p)
static

Definition at line 236 of file MessageLoggerQ.cc.

References FJR_SUMMARY, and handshakedCommand().

Referenced by edm::service::MessageLogger::SummarizeInJobReport().

237 {
238  handshakedCommand(FJR_SUMMARY, sum_p, "JRS" );
239 } // MessageLoggerQ::CFG()
static void handshakedCommand(OpCode opcode, void *operand, std::string const &commandMnemonic)
void MessageLoggerQ::MLqLOG ( ErrorObj p)
static

Definition at line 188 of file MessageLoggerQ.cc.

References LOG_A_MESSAGE, and simpleCommand().

Referenced by edm::MessageSender::ErrorObjDeleter::operator()().

189 {
190  simpleCommand (LOG_A_MESSAGE, static_cast<void *>(p));
191 } // MessageLoggerQ::LOG()
static void simpleCommand(OpCode opcode, void *operand)
void MessageLoggerQ::MLqMOD ( std::string *  jm)
static

Definition at line 213 of file MessageLoggerQ.cc.

References JOBMODE, and simpleCommand().

Referenced by edm::service::MessageLogger::MessageLogger().

214 {
215  simpleCommand (JOBMODE, static_cast<void *>(jm));
216 } // MessageLoggerQ::MOD()
static void simpleCommand(OpCode opcode, void *operand)
void MessageLoggerQ::MLqSHT ( )
static

Definition at line 182 of file MessageLoggerQ.cc.

References SHUT_UP, and simpleCommand().

Referenced by edm::HaltMessageLogging().

183 {
184  simpleCommand (SHUT_UP, (void *)0);
185 } // MessageLoggerQ::SHT()
static void simpleCommand(OpCode opcode, void *operand)
void MessageLoggerQ::MLqSUM ( )
static

Definition at line 207 of file MessageLoggerQ.cc.

References simpleCommand(), and SUMMARIZE.

Referenced by edm::service::MessageLogger::jobFailure(), edm::LogStatistics(), and edm::service::MessageLogger::postEndJob().

208 {
209  simpleCommand (SUMMARIZE, 0);
210 } // MessageLoggerQ::SUM()
static void simpleCommand(OpCode opcode, void *operand)
void edm::MessageLoggerQ::operator= ( MessageLoggerQ const &  )
private
void MessageLoggerQ::setMLscribe_ptr ( std::shared_ptr< edm::service::AbstractMLscribe m)
static
void MessageLoggerQ::simpleCommand ( OpCode  opcode,
void *  operand 
)
staticprivate

Definition at line 149 of file MessageLoggerQ.cc.

References mlscribe_ptr.

Referenced by MLqEND(), MLqEXT(), MLqGRP(), MLqLOG(), MLqMOD(), MLqSHT(), and MLqSUM().

150 {
151  mlscribe_ptr->runCommand(opcode, operand);
152 } // simpleCommand
static std::shared_ptr< edm::service::AbstractMLscribe > mlscribe_ptr
void MessageLoggerQ::squelch ( std::string const &  category)
static

Definition at line 254 of file MessageLoggerQ.cc.

References squelchSet.

Referenced by edm::squelchStandAloneMessageCategory().

254  {
255  squelchSet.insert(category);
256 }
static std::set< std::string > squelchSet
void MessageLoggerQ::standAloneThreshold ( edm::ELseverityLevel const &  severity)
static

Definition at line 251 of file MessageLoggerQ.cc.

References HLT_25ns10e33_v2_cff::severity, and threshold.

Referenced by edm::setStandAloneMessageThreshold().

251  {
253 }
static edm::ELseverityLevel threshold

Member Data Documentation

std::shared_ptr< edm::service::AbstractMLscribe > MessageLoggerQ::mlscribe_ptr = obtainStandAloneScribePtr()
staticprivate

Definition at line 86 of file MessageLoggerQ.h.

Referenced by handshakedCommand(), and simpleCommand().

std::set< std::string > MessageLoggerQ::squelchSet
staticprivate

Definition at line 88 of file MessageLoggerQ.h.

Referenced by ignore(), and squelch().

edm::ELseverityLevel MessageLoggerQ::threshold
staticprivate

Definition at line 87 of file MessageLoggerQ.h.

Referenced by utils.StatisticalTest::get_status(), ignore(), and standAloneThreshold().