CMS 3D CMS Logo

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 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 &)=delete
 
void operator= (MessageLoggerQ const &)=delete
 
 ~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::AbstractMLscribemlscribe_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 123 of file MessageLoggerQ.cc.

124 { }
MessageLoggerQ::~MessageLoggerQ ( )
private

Definition at line 127 of file MessageLoggerQ.cc.

128 { }
edm::MessageLoggerQ::MessageLoggerQ ( MessageLoggerQ const &  )
privatedelete

Member Function Documentation

bool MessageLoggerQ::handshaked ( const OpCode op)
static

Definition at line 238 of file MessageLoggerQ.cc.

References edm::ELseverityLevel::ELsev_warning, squelchSet, and threshold.

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

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

Definition at line 156 of file MessageLoggerQ.cc.

References MessageLogger_cfi::cerr, and cms::Exception::what().

160 { // Change Log 10
161  try {
162  mlscribe_ptr->runCommand(opcode, operand);
163  }
164  catch(edm::Exception& ex)
165  {
166  ex << "\n The preceding exception was thrown in MessageLoggerScribe\n";
167  ex << "and forwarded to the main thread from the Messages thread.";
168  std::cerr << "exception from MessageLoggerQ::"
169  << commandMnemonic << " - exception what() is \n"
170  << ex.what();
171  // TODO - get the above text into the what itself
172  throw ex;
173  }
174 } // handshakedCommand
char const * what() const override
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 252 of file MessageLoggerQ.cc.

References electronIdCutBased_cfi::threshold.

253  {
254  if ( severity < threshold ) return true;
255  if ( squelchSet.count(category) > 0 ) return true;
256  return false;
257 }
static edm::ELseverityLevel threshold
static std::set< std::string > squelchSet
MessageLoggerQ * MessageLoggerQ::instance ( )
static

Definition at line 132 of file MessageLoggerQ.cc.

References CMS_THREAD_SAFE, createBeamHaloJobs::queue, and setMLscribe_ptr().

133 {
135  return &queue;
136 } // MessageLoggerQ::instance()
#define CMS_THREAD_SAFE
void MessageLoggerQ::MLqCFG ( ParameterSet p)
static

Definition at line 196 of file MessageLoggerQ.cc.

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

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

Definition at line 177 of file MessageLoggerQ.cc.

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

178 {
179  simpleCommand (END_THREAD, (void *)nullptr);
180 } // MessageLoggerQ::END()
static void simpleCommand(OpCode opcode, void *operand)
void MessageLoggerQ::MLqFLS ( )
static

Definition at line 215 of file MessageLoggerQ.cc.

Referenced by edm::FlushMessageLog().

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

Definition at line 225 of file MessageLoggerQ.cc.

Referenced by edm::GroupLogStatistics().

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

Definition at line 231 of file MessageLoggerQ.cc.

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

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

Definition at line 189 of file MessageLoggerQ.cc.

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

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

Definition at line 208 of file MessageLoggerQ.cc.

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

209 {
210  simpleCommand (JOBMODE, static_cast<void *>(jm));
211 } // MessageLoggerQ::MOD()
static void simpleCommand(OpCode opcode, void *operand)
void MessageLoggerQ::MLqSHT ( )
static

Definition at line 183 of file MessageLoggerQ.cc.

Referenced by edm::HaltMessageLogging().

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

Definition at line 202 of file MessageLoggerQ.cc.

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

203 {
204  simpleCommand (SUMMARIZE, nullptr);
205 } // MessageLoggerQ::SUM()
static void simpleCommand(OpCode opcode, void *operand)
void edm::MessageLoggerQ::operator= ( MessageLoggerQ const &  )
privatedelete
void MessageLoggerQ::setMLscribe_ptr ( std::shared_ptr< edm::service::AbstractMLscribe m)
static

Definition at line 140 of file MessageLoggerQ.cc.

References funct::m.

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

141 {
142  if (!m) {
143  mlscribe_ptr = obtainStandAloneScribePtr();
144  } else {
145  mlscribe_ptr = m;
146  }
147 } // MessageLoggerQ::setMLscribe_ptr(m)
static std::shared_ptr< edm::service::AbstractMLscribe > mlscribe_ptr
void MessageLoggerQ::simpleCommand ( OpCode  opcode,
void *  operand 
)
staticprivate

Definition at line 150 of file MessageLoggerQ.cc.

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

Definition at line 249 of file MessageLoggerQ.cc.

Referenced by edm::squelchStandAloneMessageCategory().

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

Member Data Documentation

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

Definition at line 85 of file MessageLoggerQ.h.

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

Definition at line 87 of file MessageLoggerQ.h.

Referenced by handshaked().

edm::ELseverityLevel MessageLoggerQ::threshold
staticprivate

Definition at line 86 of file MessageLoggerQ.h.

Referenced by utils.StatisticalTest::get_status(), and handshaked().