CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | 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
}
 

Public Member Functions

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

Static Public Member Functions

static bool handshaked (const OpCode &op)
 
static bool ignore (edm::messagelogger::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::messagelogger::ELseverityLevel const &severity)
 

Private Member Functions

 MessageLoggerQ ()
 
 ~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::messagelogger::ELseverityLevel threshold
 

Detailed Description

Definition at line 23 of file MessageLoggerQ.h.

Member Enumeration Documentation

◆ OpCode

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.

30  { END_THREAD // END
31  ,
32  LOG_A_MESSAGE // LOG
33  ,
34  CONFIGURE // CFG -- handshaked
35  ,
36  EXTERN_DEST // EXT
37  ,
38  SUMMARIZE // SUM
39  ,
40  JOBMODE // MOD
41  ,
42  SHUT_UP // SHT
43  ,
44  FLUSH_LOG_Q // FLS -- handshaked
45  ,
46  GROUP_STATS // GRP
47  ,
48  FJR_SUMMARY // JRS -- handshaked
49  }; // OpCode

Constructor & Destructor Documentation

◆ MessageLoggerQ() [1/2]

edm::MessageLoggerQ::MessageLoggerQ ( MessageLoggerQ const &  )
delete

◆ MessageLoggerQ() [2/2]

MessageLoggerQ::MessageLoggerQ ( )
private

Definition at line 115 of file MessageLoggerQ.cc.

115 {}

◆ ~MessageLoggerQ()

MessageLoggerQ::~MessageLoggerQ ( )
private

Definition at line 117 of file MessageLoggerQ.cc.

117 {}

Member Function Documentation

◆ handshaked()

bool MessageLoggerQ::handshaked ( const OpCode op)
static

Definition at line 186 of file MessageLoggerQ.cc.

187 {
188  return ((op == CONFIGURE) || (op == FLUSH_LOG_Q) || (op == FJR_SUMMARY));
189 } // MessageLoggerQ::handshaked(op)

References CONFIGURE, FJR_SUMMARY, and FLUSH_LOG_Q.

◆ handshakedCommand()

void MessageLoggerQ::handshakedCommand ( OpCode  opcode,
void *  operand,
std::string const &  commandMnemonic 
)
staticprivate

Definition at line 138 of file MessageLoggerQ.cc.

140  { // Change Log 10
141  try {
142  mlscribe_ptr->runCommand(opcode, operand);
143  } catch (edm::Exception &ex) {
144  ex << "\n The preceding exception was thrown in MessageLoggerScribe\n";
145  ex << "and forwarded to the main thread from the Messages thread.";
146  std::cerr << "exception from MessageLoggerQ::" << commandMnemonic << " - exception what() is \n" << ex.what();
147  // TODO - get the above text into the what itself
148  throw ex;
149  }
150 } // handshakedCommand

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, mlscribe_ptr, and cms::Exception::what().

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

◆ ignore()

bool MessageLoggerQ::ignore ( edm::messagelogger::ELseverityLevel const &  severity,
std::string const &  category 
)
static

Definition at line 196 of file MessageLoggerQ.cc.

196  {
197  if (severity < threshold)
198  return true;
199  if (squelchSet.count(category) > 0)
200  return true;
201  return false;
202 }

References taus_updatedMVAIds_cff::category, ErrorSummaryFilter_cfi::severity, squelchSet, and threshold.

◆ instance()

MessageLoggerQ * MessageLoggerQ::instance ( )
static

Definition at line 119 of file MessageLoggerQ.cc.

119  {
121  return &queue;
122 } // MessageLoggerQ::instance()

References CMS_THREAD_SAFE, and createBeamHaloJobs::queue.

◆ MLqCFG()

void MessageLoggerQ::MLqCFG ( ParameterSet p)
static

Definition at line 160 of file MessageLoggerQ.cc.

160 { handshakedCommand(CONFIGURE, p, "CFG"); } // MessageLoggerQ::CFG()

References CONFIGURE, handshakedCommand(), and AlCaHLTBitMon_ParallelJobs::p.

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

◆ MLqEND()

void MessageLoggerQ::MLqEND ( )
static

Definition at line 152 of file MessageLoggerQ.cc.

152 { simpleCommand(END_THREAD, (void *)nullptr); } // MessageLoggerQ::END()

References END_THREAD, and simpleCommand().

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

◆ MLqFLS()

void MessageLoggerQ::MLqFLS ( )
static

Definition at line 168 of file MessageLoggerQ.cc.

169 {
170  // The ConfigurationHandshake, developed for synchronous CFG, contains a
171  // place to convey exception information. FLS does not need this, nor does
172  // it need the parameter set, but we are reusing ConfigurationHandshake
173  // rather than reinventing the mechanism.
174  handshakedCommand(FLUSH_LOG_Q, nullptr, "FLS");
175 } // MessageLoggerQ::FLS()

References FLUSH_LOG_Q, and handshakedCommand().

Referenced by edm::FlushMessageLog().

◆ MLqGRP()

void MessageLoggerQ::MLqGRP ( std::string *  cat_p)
static

Definition at line 177 of file MessageLoggerQ.cc.

178 {
179  simpleCommand(GROUP_STATS, static_cast<void *>(cat_p));
180 } // MessageLoggerQ::GRP()

References GROUP_STATS, and simpleCommand().

Referenced by edm::GroupLogStatistics().

◆ MLqJRS()

void MessageLoggerQ::MLqJRS ( std::map< std::string, double > *  sum_p)
static

Definition at line 182 of file MessageLoggerQ.cc.

182  {
183  handshakedCommand(FJR_SUMMARY, sum_p, "JRS");
184 } // MessageLoggerQ::CFG()

References FJR_SUMMARY, and handshakedCommand().

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

◆ MLqLOG()

void MessageLoggerQ::MLqLOG ( ErrorObj p)
static

Definition at line 156 of file MessageLoggerQ.cc.

156  {
157  simpleCommand(LOG_A_MESSAGE, static_cast<void *>(p));
158 } // MessageLoggerQ::LOG()

References LOG_A_MESSAGE, AlCaHLTBitMon_ParallelJobs::p, and simpleCommand().

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

◆ MLqMOD()

void MessageLoggerQ::MLqMOD ( std::string *  jm)
static

Definition at line 164 of file MessageLoggerQ.cc.

164  {
165  simpleCommand(JOBMODE, static_cast<void *>(jm));
166 } // MessageLoggerQ::MOD()

References JOBMODE, and simpleCommand().

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

◆ MLqSHT()

void MessageLoggerQ::MLqSHT ( )
static

Definition at line 154 of file MessageLoggerQ.cc.

154 { simpleCommand(SHUT_UP, (void *)nullptr); } // MessageLoggerQ::SHT()

References SHUT_UP, and simpleCommand().

Referenced by edm::HaltMessageLogging().

◆ MLqSUM()

void MessageLoggerQ::MLqSUM ( )
static

Definition at line 162 of file MessageLoggerQ.cc.

162 { simpleCommand(SUMMARIZE, nullptr); } // MessageLoggerQ::SUM()

References simpleCommand(), and SUMMARIZE.

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

◆ operator=()

void edm::MessageLoggerQ::operator= ( MessageLoggerQ const &  )
delete

◆ setMLscribe_ptr()

void MessageLoggerQ::setMLscribe_ptr ( std::shared_ptr< edm::service::AbstractMLscribe m)
static

Definition at line 124 of file MessageLoggerQ.cc.

125 {
126  if (!m) {
127  mlscribe_ptr = obtainStandAloneScribePtr();
128  } else {
129  mlscribe_ptr = m;
130  }
131 } // MessageLoggerQ::setMLscribe_ptr(m)

References visualization-live-secondInstance_cfg::m, and mlscribe_ptr.

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

◆ simpleCommand()

void MessageLoggerQ::simpleCommand ( OpCode  opcode,
void *  operand 
)
staticprivate

Definition at line 133 of file MessageLoggerQ.cc.

134 {
135  mlscribe_ptr->runCommand(opcode, operand);
136 } // simpleCommand

References mlscribe_ptr.

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

◆ squelch()

void MessageLoggerQ::squelch ( std::string const &  category)
static

Definition at line 195 of file MessageLoggerQ.cc.

195 { squelchSet.insert(category); }

References taus_updatedMVAIds_cff::category, and squelchSet.

Referenced by edm::squelchStandAloneMessageCategory().

◆ standAloneThreshold()

void MessageLoggerQ::standAloneThreshold ( edm::messagelogger::ELseverityLevel const &  severity)
static

Definition at line 194 of file MessageLoggerQ.cc.

194 { threshold = severity; }

References ErrorSummaryFilter_cfi::severity, and threshold.

Referenced by edm::setStandAloneMessageThreshold().

Member Data Documentation

◆ mlscribe_ptr

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

Definition at line 86 of file MessageLoggerQ.h.

Referenced by handshakedCommand(), setMLscribe_ptr(), and simpleCommand().

◆ squelchSet

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

Definition at line 88 of file MessageLoggerQ.h.

Referenced by ignore(), and squelch().

◆ threshold

edm::messagelogger::ELseverityLevel MessageLoggerQ::threshold
staticprivate

Definition at line 87 of file MessageLoggerQ.h.

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

edm::MessageLoggerQ::squelchSet
static std::set< std::string > squelchSet
Definition: MessageLoggerQ.h:88
taus_updatedMVAIds_cff.category
category
Definition: taus_updatedMVAIds_cff.py:31
edm::MessageLoggerQ::SHUT_UP
Definition: MessageLoggerQ.h:42
edm::MessageLoggerQ::EXTERN_DEST
Definition: MessageLoggerQ.h:36
edm::MessageLoggerQ::FLUSH_LOG_Q
Definition: MessageLoggerQ.h:44
edm::MessageLoggerQ::handshakedCommand
static void handshakedCommand(OpCode opcode, void *operand, std::string const &commandMnemonic)
Definition: MessageLoggerQ.cc:138
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::MessageLoggerQ::CONFIGURE
Definition: MessageLoggerQ.h:34
cms::Exception::what
char const * what() const noexcept override
Definition: Exception.cc:103
edm::Exception
Definition: EDMException.h:77
edm::MessageLoggerQ::END_THREAD
Definition: MessageLoggerQ.h:30
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
edm::MessageLoggerQ::GROUP_STATS
Definition: MessageLoggerQ.h:46
CMS_THREAD_SAFE
#define CMS_THREAD_SAFE
Definition: thread_safety_macros.h:4
createBeamHaloJobs.queue
queue
Definition: createBeamHaloJobs.py:343
edm::MessageLoggerQ::threshold
static edm::messagelogger::ELseverityLevel threshold
Definition: MessageLoggerQ.h:87
edm::MessageLoggerQ::FJR_SUMMARY
Definition: MessageLoggerQ.h:48
edm::MessageLoggerQ::mlscribe_ptr
static std::shared_ptr< edm::service::AbstractMLscribe > mlscribe_ptr
Definition: MessageLoggerQ.h:86
edm::MessageLoggerQ::LOG_A_MESSAGE
Definition: MessageLoggerQ.h:32
ErrorSummaryFilter_cfi.severity
severity
Definition: ErrorSummaryFilter_cfi.py:5
edm::MessageLoggerQ::JOBMODE
Definition: MessageLoggerQ.h:40
edm::MessageLoggerQ
Definition: MessageLoggerQ.h:23
edm::MessageLoggerQ::SUMMARIZE
Definition: MessageLoggerQ.h:38
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
edm::MessageLoggerQ::simpleCommand
static void simpleCommand(OpCode opcode, void *operand)
Definition: MessageLoggerQ.cc:133