Namespaces | Classes | Typedefs | Functions | Variables
mf Namespace Reference

Namespaces

 detail
 
 errors
 
 priv
 
 service
 

Classes

class  ELextendedID
 
class  ELseverityLevel
 
struct  ELslProxy
 
class  ErrorObj
 
struct  file_mfPluginConfig
 
struct  file_mfStatsPluginConfig
 
struct  FinalShutdown
 
class  MaybeLogger_
 
struct  MFConfig
 
struct  MFDestinationConfig
 
class  NeverLogger_
 

Typedefs

using LogDebug = MaybeLogger_< ELseverityLevel::ELsev_success, false >
 
using LogInfo = MaybeLogger_< ELseverityLevel::ELsev_info, false >
 
using LogWarning = MaybeLogger_< ELseverityLevel::ELsev_warning, false >
 
using LogError = MaybeLogger_< ELseverityLevel::ELsev_error, false >
 
using LogSystem = MaybeLogger_< ELseverityLevel::ELsev_severe, false >
 
using LogTrace = MaybeLogger_< ELseverityLevel::ELsev_success, true >
 
using LogVerbatim = MaybeLogger_< ELseverityLevel::ELsev_info, true >
 
using LogPrint = MaybeLogger_< ELseverityLevel::ELsev_warning, true >
 
using LogProblem = MaybeLogger_< ELseverityLevel::ELsev_error, true >
 
using LogAbsolute = MaybeLogger_< ELseverityLevel::ELsev_severe, true >
 
using ELslGen) = ELseverityLevel(
 
typedef cet::coded_exception< errors::error, detail::translateException
 

Functions

bool isMessageProcessingSetUp ()
 
void LogErrorObj (ErrorObj *msg)
 
void LogStatistics ()
 
void FlushMessageLog ()
 
void StartMessageFacility (fhicl::ParameterSet const &pset, string const &applicationName)
 
void EndMessageFacility ()
 
void SetApplicationName (string const &applicationName)
 
void SetHostName (string const &hostname)
 
void SetHostAddr (string const &hostaddr)
 
void SetPid (long const pid)
 
string const & GetApplicationName ()
 
string const & GetHostName ()
 
string const & GetHostAddr ()
 
long GetPid ()
 
void SetContextIteration (string const &val)
 
void SetIteration (string const &val)
 
string const & GetIteration ()
 
void SetContextSinglet (string const &val)
 
void SetModuleName (string const &val)
 
string const & GetModuleName ()
 
bool isDebugEnabled ()
 
bool isInfoEnabled ()
 
bool isWarningEnabled ()
 
std::ostringstream & getStringStream (std::string const &psetName)
 
ostream & operator<< (ostream &os, ELseverityLevel const sev)
 
ELseverityLevel constexpr ELzeroSeverityGen ()
 
ELseverityLevel constexpr ELsuccessGen ()
 
ELseverityLevel constexpr ELdebugGen ()
 
ELseverityLevel constexpr ELinfoGen ()
 
ELseverityLevel constexpr ELwarningGen ()
 
ELseverityLevel constexpr ELerrorGen ()
 
ELseverityLevel constexpr ELunspecifiedGen ()
 
ELseverityLevel constexpr ELsevereGen ()
 
ELseverityLevel constexpr ELhighestSeverityGen ()
 
bool operator== (ELseverityLevel e1, ELseverityLevel e2)
 
bool operator!= (ELseverityLevel e1, ELseverityLevel e2)
 
bool operator< (ELseverityLevel e1, ELseverityLevel e2)
 
bool operator<= (ELseverityLevel e1, ELseverityLevel e2)
 
bool operator> (ELseverityLevel e1, ELseverityLevel e2)
 
bool operator>= (ELseverityLevel e1, ELseverityLevel e2)
 
ErrorObjoperator<< (ErrorObj &e, char const *s)
 
template<class T >
ErrorObjoperator<< (ErrorObj &e, T const &t)
 

Variables

static struct mf::FinalShutdown ensureShutdown
 
ELslProxy< ELzeroSeverityGen > constexpr ELzeroSeverity {}
 
ELslProxy< ELdebugGen > constexpr ELdebug {}
 
ELslProxy< ELsuccessGen > constexpr ELsuccess {}
 
ELslProxy< ELinfoGen > constexpr ELinfo {}
 
ELslProxy< ELwarningGen > constexpr ELwarning {}
 
ELslProxy< ELerrorGen > constexpr ELerror {}
 
ELslProxy< ELunspecifiedGen > constexpr ELunspecified {}
 
ELslProxy< ELsevereGen > constexpr ELsevere {}
 
ELslProxy< ELhighestSeverityGen > constexpr ELhighestSeverity {}
 
static atomic< int > ourSerial {0}
 

Typedef Documentation

using mf::ELslGen = typedef ELseverityLevel(

Definition at line 12 of file ELseverityLevel.h.

typedef cet::coded_exception<errors::error, detail::translate> mf::Exception

Definition at line 16 of file exception.h.

Definition at line 219 of file MessageLogger.h.

Definition at line 208 of file MessageLogger.h.

Definition at line 211 of file MessageLogger.h.

Definition at line 209 of file MessageLogger.h.

Definition at line 217 of file MessageLogger.h.

Definition at line 218 of file MessageLogger.h.

Definition at line 212 of file MessageLogger.h.

Definition at line 215 of file MessageLogger.h.

Definition at line 216 of file MessageLogger.h.

Definition at line 210 of file MessageLogger.h.

Function Documentation

ELseverityLevel constexpr mf::ELdebugGen ( )
inline

Definition at line 77 of file ELseverityLevel.h.

78  {
79  return ELseverityLevel::ELsev_success;
80  }
ELseverityLevel constexpr mf::ELerrorGen ( )
inline

Definition at line 92 of file ELseverityLevel.h.

93  {
94  return ELseverityLevel::ELsev_error;
95  }
ELseverityLevel constexpr mf::ELhighestSeverityGen ( )
inline

Definition at line 107 of file ELseverityLevel.h.

108  {
109  return ELseverityLevel::ELsev_highestSeverity;
110  }
ELseverityLevel constexpr mf::ELinfoGen ( )
inline

Definition at line 82 of file ELseverityLevel.h.

83  {
84  return ELseverityLevel::ELsev_info;
85  }
ELseverityLevel constexpr mf::ELsevereGen ( )
inline

Definition at line 102 of file ELseverityLevel.h.

103  {
104  return ELseverityLevel::ELsev_severe;
105  }
ELseverityLevel constexpr mf::ELsuccessGen ( )
inline

Definition at line 72 of file ELseverityLevel.h.

73  {
74  return ELseverityLevel::ELsev_success;
75  }
ELseverityLevel constexpr mf::ELunspecifiedGen ( )
inline

Definition at line 97 of file ELseverityLevel.h.

98  {
99  return ELseverityLevel::ELsev_unspecified;
100  }
ELseverityLevel constexpr mf::ELwarningGen ( )
inline

Definition at line 87 of file ELseverityLevel.h.

88  {
89  return ELseverityLevel::ELsev_warning;
90  }
ELseverityLevel constexpr mf::ELzeroSeverityGen ( )
inline

Definition at line 67 of file ELseverityLevel.h.

68  {
69  return ELseverityLevel::ELsev_zeroSeverity;
70  }
void mf::EndMessageFacility ( )

Definition at line 496 of file MessageLogger.cc.

497  {
498  isStarted.store(false);
499  // FIXME: The finish() call in all known uses does nothing, the destination
500  // dtor can probably handle this, remove!
501  for (auto& category_and_destination : destinations_) {
502  category_and_destination.second->finish();
503  }
504  }
void mf::FlushMessageLog ( )

Definition at line 455 of file MessageLogger.cc.

456  {}
std::string const & mf::GetApplicationName ( )

Definition at line 536 of file MessageLogger.cc.

537  {
538  return application_;
539  }
std::string const & mf::GetHostAddr ( )

Definition at line 550 of file MessageLogger.cc.

551  {
552  return hostaddr_;
553  }
std::string const & mf::GetHostName ( )

Definition at line 543 of file MessageLogger.cc.

544  {
545  return hostname_;
546  }
std::string const & mf::GetIteration ( )

Definition at line 580 of file MessageLogger.cc.

581  {
582  return iteration_;
583  }
std::string const & mf::GetModuleName ( )

Definition at line 601 of file MessageLogger.cc.

602  {
603  return module_;
604  }
long mf::GetPid ( )

Definition at line 557 of file MessageLogger.cc.

558  {
559  return pid_;
560  }
ostringstream & mf::getStringStream ( std::string const &  psetName)

Definition at line 15 of file stringstream.cc.

16 {
17  auto const I = streams.find(psetName);
18  if (I != streams.end()) {
19  return dynamic_cast<ostringstream&>(static_cast<ostream&>(I->second));
20  }
21  throw Exception(errors::Configuration, "mf::getStringStream:")
22  << "Unable to find specified messagefacility logging stream \"" << psetName
23  << ":\" please ensure it has been configured as a destination.";
24 }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::map< std::string, cet::ostream_handle > streams
Definition: stringstream.cc:9
bool mf::isDebugEnabled ( )

Definition at line 611 of file MessageLogger.cc.

612  {
613  return false;
614  }
bool mf::isInfoEnabled ( )

Definition at line 621 of file MessageLogger.cc.

622  {
623  return true;
624  }
bool mf::isMessageProcessingSetUp ( )

Definition at line 416 of file MessageLogger.cc.

417  {
418  return isStarted.load();
419  }
bool mf::isWarningEnabled ( )

Definition at line 631 of file MessageLogger.cc.

632  {
633  return true;
634  }
void mf::LogErrorObj ( ErrorObj msg)

Definition at line 423 of file MessageLogger.cc.

424  {
425  if (isStarted.load()) {
426  logMessage(msg);
427  return;
428  }
429  if (msg->is_verbatim()) {
430  ostringstream buf;
431  buf << msg->fullText() << '\n';
432  cerr << buf.str();
433  } else {
434  ostringstream buf;
435  buf << "%MSG" << msg->xid().severity().getSymbol() << ' '
436  << msg->xid().id() << msg->idOverflow() << ": \n"
437  << msg->fullText() << "\n"
438  << "%MSG\n";
439  cerr << buf.str();
440  }
441  delete msg;
442  }
void msg(const char *fmt,...)
Definition: message.cpp:107
void mf::LogStatistics ( )

Definition at line 446 of file MessageLogger.cc.

447  {
448  if (isStarted.load()) {
449  summarize();
450  }
451  }
bool mf::operator!= ( ELseverityLevel  e1,
ELseverityLevel  e2 
)
inline

Definition at line 177 of file ELseverityLevel.h.

178  {
179  return e1.cmp(e2) != 0;
180  }
bool mf::operator< ( ELseverityLevel  e1,
ELseverityLevel  e2 
)
inline

Definition at line 183 of file ELseverityLevel.h.

184  {
185  return e1.cmp(e2) < 0;
186  }
template<class T >
ErrorObj& mf::operator<< ( ErrorObj e,
T const &  t 
)

Definition at line 111 of file ErrorObj.h.

112  {
113  return e.opltlt(t);
114  }
const double e
ostream& mf::operator<< ( std::ostream &  os,
ELseverityLevel const  sev 
)

Definition at line 214 of file ELseverityLevel.cc.

215  {
216  return os << " -" << sev.getName() << "- ";
217  }
ErrorObj & mf::operator<< ( ErrorObj e,
char const *  s 
)

Definition at line 275 of file ErrorObj.cc.

276  {
277  return e.opltlt(s);
278  }
const double e
static QCString * s
Definition: config.cpp:1042
bool mf::operator<= ( ELseverityLevel  e1,
ELseverityLevel  e2 
)
inline

Definition at line 189 of file ELseverityLevel.h.

190  {
191  return e1.cmp(e2) <= 0;
192  }
bool mf::operator== ( ELseverityLevel  e1,
ELseverityLevel  e2 
)
inline

Definition at line 171 of file ELseverityLevel.h.

172  {
173  return e1.cmp(e2) == 0;
174  }
bool mf::operator> ( ELseverityLevel  e1,
ELseverityLevel  e2 
)
inline

Definition at line 195 of file ELseverityLevel.h.

196  {
197  return e1.cmp(e2) > 0;
198  }
bool mf::operator>= ( ELseverityLevel  e1,
ELseverityLevel  e2 
)
inline

Definition at line 201 of file ELseverityLevel.h.

202  {
203  return e1.cmp(e2) >= 0;
204  }
void mf::SetApplicationName ( string const &  applicationName)

Definition at line 508 of file MessageLogger.cc.

509  {
510  application_ = applicationName;
511  }
void mf::SetContextIteration ( string const &  val)

Definition at line 566 of file MessageLogger.cc.

567  {
568  iteration_ = val;
569  }
void mf::SetContextSinglet ( string const &  val)

Definition at line 588 of file MessageLogger.cc.

589  {
590  module_ = val;
591  }
void mf::SetHostAddr ( string const &  hostaddr)

Definition at line 522 of file MessageLogger.cc.

523  {
524  hostaddr_ = hostaddr;
525  }
void mf::SetHostName ( string const &  hostname)

Definition at line 515 of file MessageLogger.cc.

516  {
517  hostname_ = hostname;
518  }
void mf::SetIteration ( string const &  val)

Definition at line 574 of file MessageLogger.cc.

575  {
576  iteration_ = val;
577  }
void mf::SetModuleName ( string const &  val)

Definition at line 595 of file MessageLogger.cc.

596  {
597  module_ = val;
598  }
void mf::SetPid ( long const  pid)

Definition at line 529 of file MessageLogger.cc.

530  {
531  pid_ = pid;
532  }
void mf::StartMessageFacility ( fhicl::ParameterSet const &  pset,
string const &  applicationName 
)

Definition at line 460 of file MessageLogger.cc.

462  {
463  if (isStarted.load()) {
464  return;
465  }
466  // FIXME: We should not have to call StartMessageFacility() to get these
467  // initialized!
468  initGlobalVars(applicationName);
469  try {
470  destinations_["cerr_early"s] = makePlugin_(
471  pluginFactory_, "cerr", "cerr_early", default_destination_config());
472  }
473  catch (fhicl::detail::validationException const& e) {
474  string msg{"\nConfiguration error for destination: " +
475  cet::bold_fontify("cerr_early") + "\n\n"};
476  msg += e.what();
478  }
479  try {
480  // Note: We make all the destinations here.
481  configure(MFDestinationConfig::Config{
482  MFConfig::Parameters{pset}().destinations()});
483  }
484  catch (Exception const& ex) {
485  // FIXME: Hardly seems necessary to rethrow just to change the message to
486  // say it was during configure!
488  "Exception from MessageLoggerScribe::configure",
489  ex);
490  }
491  isStarted.store(true);
492  }
void msg(const char *fmt,...)
Definition: message.cpp:107
typename config_impl< T >::type Config
Definition: ModuleMacros.h:52
const double e
std::string bold_fontify(std::string const &s)
Definition: bold_fontify.h:8
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
char const * what() const noexcept override
static QCString * s
Definition: config.cpp:1042

Variable Documentation

ELslProxy<ELdebugGen> constexpr mf::ELdebug {}

Definition at line 113 of file ELseverityLevel.h.

ELslProxy<ELerrorGen> constexpr mf::ELerror {}

Definition at line 117 of file ELseverityLevel.h.

ELslProxy<ELhighestSeverityGen> constexpr mf::ELhighestSeverity {}

Definition at line 120 of file ELseverityLevel.h.

ELslProxy<ELinfoGen> constexpr mf::ELinfo {}

Definition at line 115 of file ELseverityLevel.h.

ELslProxy<ELsevereGen> constexpr mf::ELsevere {}

Definition at line 119 of file ELseverityLevel.h.

ELslProxy<ELsuccessGen> constexpr mf::ELsuccess {}

Definition at line 114 of file ELseverityLevel.h.

ELslProxy<ELunspecifiedGen> constexpr mf::ELunspecified {}

Definition at line 118 of file ELseverityLevel.h.

ELslProxy<ELwarningGen> constexpr mf::ELwarning {}

Definition at line 116 of file ELseverityLevel.h.

ELslProxy<ELzeroSeverityGen> constexpr mf::ELzeroSeverity {}

Definition at line 112 of file ELseverityLevel.h.

struct mf::FinalShutdown mf::ensureShutdown
static
atomic<int> mf::ourSerial {0}
static

Definition at line 18 of file ErrorObj.cc.