Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
mf::MessageLoggerQ Class Reference

#include <MessageLoggerQ.h>

Classes

struct  Config
 

Public Member Functions

 MessageLoggerQ (MessageLoggerQ const &)=delete
 
MessageLoggerQoperator= (MessageLoggerQ const &)=delete
 

Static Public Member Functions

static MessageLoggerQinstance ()
 
static void MLqEND ()
 
static void MLqLOG (ErrorObj *p)
 
static void MLqCFG (Config *p)
 
static void MLqSUM ()
 
static void MLqSHT ()
 
static void MLqFLS ()
 
static void setMLscribe_ptr (std::unique_ptr< mf::service::AbstractMLscribe > m)
 
static void standAloneThreshold (mf::ELseverityLevel severity)
 
static void squelch (std::string const &category)
 
static bool ignore (mf::ELseverityLevel severity, std::string const &category)
 
static void setApplication (std::string const &application)
 
static void setHostName (std::string const &name)
 
static void setHostAddr (std::string const &addr)
 
static void setPID (long PID)
 

Private Member Functions

 MessageLoggerQ ()=default
 
 ~MessageLoggerQ ()=default
 

Static Private Member Functions

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

Static Private Attributes

static std::unique_ptr< mf::service::AbstractMLscribemlscribe_ptr
 
static mf::ELseverityLevel threshold
 
static std::set< std::stringsquelchSet
 

Detailed Description

Definition at line 25 of file MessageLoggerQ.h.

Constructor & Destructor Documentation

mf::MessageLoggerQ::MessageLoggerQ ( MessageLoggerQ const &  )
delete
mf::MessageLoggerQ::MessageLoggerQ ( )
privatedefault
mf::MessageLoggerQ::~MessageLoggerQ ( )
privatedefault

Member Function Documentation

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

Definition at line 86 of file MessageLoggerQ.cc.

88  {
89  mlscribe_ptr->runCommand(opcode, operand);
90 }
91 catch (mf::Exception const& ex) {
93  "Exception from MessageLoggerQ::" + commandMnemonic,
94  ex);
95 } // handshakedCommand
cet::coded_exception< errors::error, detail::translate > Exception
Definition: exception.h:16
static std::unique_ptr< mf::service::AbstractMLscribe > mlscribe_ptr
bool MessageLoggerQ::ignore ( mf::ELseverityLevel  severity,
std::string const &  category 
)
static

Definition at line 149 of file MessageLoggerQ.cc.

151 {
152  if (severity < threshold)
153  return true;
154  if (squelchSet.count(category) > 0)
155  return true;
156  return false;
157 }
static mf::ELseverityLevel threshold
static std::set< std::string > squelchSet
MessageLoggerQ * MessageLoggerQ::instance ( )
static

Definition at line 64 of file MessageLoggerQ.cc.

65 {
66  static MessageLoggerQ queue;
67  return &queue;
68 }
void MessageLoggerQ::MLqCFG ( Config p)
static

Definition at line 116 of file MessageLoggerQ.cc.

117 {
118  handshakedCommand(CONFIGURE, p, "CFG");
119 }
static void handshakedCommand(service::OpCode opcode, void *operand, std::string const &commandMnemonic)
void MessageLoggerQ::MLqEND ( )
static

Definition at line 98 of file MessageLoggerQ.cc.

99 {
100  simpleCommand(END_THREAD, nullptr);
101 }
static void simpleCommand(service::OpCode opcode, void *operand)
void MessageLoggerQ::MLqFLS ( )
static

Definition at line 128 of file MessageLoggerQ.cc.

129 {
130  handshakedCommand(FLUSH_LOG_Q, nullptr, "FLS");
131 }
static void handshakedCommand(service::OpCode opcode, void *operand, std::string const &commandMnemonic)
void MessageLoggerQ::MLqLOG ( ErrorObj p)
static

Definition at line 110 of file MessageLoggerQ.cc.

111 {
112  simpleCommand(LOG_A_MESSAGE, static_cast<void*>(p));
113 }
static void simpleCommand(service::OpCode opcode, void *operand)
void MessageLoggerQ::MLqSHT ( )
static

Definition at line 104 of file MessageLoggerQ.cc.

105 {
106  simpleCommand(SHUT_UP, nullptr);
107 }
static void simpleCommand(service::OpCode opcode, void *operand)
void MessageLoggerQ::MLqSUM ( )
static

Definition at line 122 of file MessageLoggerQ.cc.

123 {
124  simpleCommand(SUMMARIZE, nullptr);
125 }
static void simpleCommand(service::OpCode opcode, void *operand)
MessageLoggerQ& mf::MessageLoggerQ::operator= ( MessageLoggerQ const &  )
delete
void MessageLoggerQ::setApplication ( std::string const &  application)
static

Definition at line 160 of file MessageLoggerQ.cc.

161 {
162  mlscribe_ptr->setApplication(application);
163 }
static std::unique_ptr< mf::service::AbstractMLscribe > mlscribe_ptr
void MessageLoggerQ::setHostAddr ( std::string const &  addr)
static

Definition at line 172 of file MessageLoggerQ.cc.

173 {
174  mlscribe_ptr->setHostAddr(hostAddr);
175 }
static std::unique_ptr< mf::service::AbstractMLscribe > mlscribe_ptr
void MessageLoggerQ::setHostName ( std::string const &  name)
static

Definition at line 166 of file MessageLoggerQ.cc.

167 {
168  mlscribe_ptr->setHostName(hostName);
169 }
static std::unique_ptr< mf::service::AbstractMLscribe > mlscribe_ptr
void MessageLoggerQ::setMLscribe_ptr ( std::unique_ptr< mf::service::AbstractMLscribe m)
static

Definition at line 70 of file MessageLoggerQ.cc.

71 {
72  if (!m) {
73  mlscribe_ptr = obtainStandAloneScribePtr();
74  } else {
75  mlscribe_ptr = std::move(m);
76  }
77 }
static std::unique_ptr< mf::service::AbstractMLscribe > mlscribe_ptr
void MessageLoggerQ::setPID ( long  PID)
static

Definition at line 178 of file MessageLoggerQ.cc.

179 {
180  mlscribe_ptr->setPID(pid);
181 }
static std::unique_ptr< mf::service::AbstractMLscribe > mlscribe_ptr
void MessageLoggerQ::simpleCommand ( service::OpCode  opcode,
void *  operand 
)
staticprivate

Definition at line 80 of file MessageLoggerQ.cc.

81 {
82  mlscribe_ptr->runCommand(opcode, operand);
83 }
static std::unique_ptr< mf::service::AbstractMLscribe > mlscribe_ptr
void MessageLoggerQ::squelch ( std::string const &  category)
static

Definition at line 143 of file MessageLoggerQ.cc.

144 {
145  squelchSet.insert(category);
146 }
static std::set< std::string > squelchSet
void MessageLoggerQ::standAloneThreshold ( mf::ELseverityLevel  severity)
static

Definition at line 137 of file MessageLoggerQ.cc.

138 {
139  threshold = severity;
140 }
static mf::ELseverityLevel threshold

Member Data Documentation

std::unique_ptr< AbstractMLscribe > MessageLoggerQ::mlscribe_ptr
staticprivate
Initial value:
=
obtainStandAloneScribePtr()

Definition at line 120 of file MessageLoggerQ.h.

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

Definition at line 122 of file MessageLoggerQ.h.

mf::ELseverityLevel MessageLoggerQ::threshold
staticprivate

Definition at line 121 of file MessageLoggerQ.h.


The documentation for this class was generated from the following files: