LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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(
 
using Exception = cet::coded_exception< errors::error, detail::translate >
 

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.

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

Definition at line 17 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.

References mf::ELseverityLevel::ELsev_success.

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

Definition at line 92 of file ELseverityLevel.h.

References mf::ELseverityLevel::ELsev_error.

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

Definition at line 107 of file ELseverityLevel.h.

References mf::ELseverityLevel::ELsev_highestSeverity.

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

Definition at line 82 of file ELseverityLevel.h.

References mf::ELseverityLevel::ELsev_info.

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

Definition at line 102 of file ELseverityLevel.h.

References mf::ELseverityLevel::ELsev_severe.

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

Definition at line 72 of file ELseverityLevel.h.

References mf::ELseverityLevel::ELsev_success.

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

Definition at line 97 of file ELseverityLevel.h.

References mf::ELseverityLevel::ELsev_unspecified.

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

Definition at line 87 of file ELseverityLevel.h.

References mf::ELseverityLevel::ELsev_warning.

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

Definition at line 67 of file ELseverityLevel.h.

References mf::ELseverityLevel::ELsev_zeroSeverity.

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

Definition at line 502 of file MessageLogger.cc.

Referenced by main(), and mf::FinalShutdown::~FinalShutdown().

503  {
504  isStarted.store(false);
505  // FIXME: The finish() call in all known uses does nothing, the destination
506  // dtor can probably handle this, remove!
507  for (auto& category_and_destination : destinations_) {
508  category_and_destination.second->finish();
509  }
510  }
void mf::FlushMessageLog ( )

Definition at line 453 of file MessageLogger.cc.

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

Definition at line 542 of file MessageLogger.cc.

543  {
544  return application_;
545  }
std::string const & mf::GetHostAddr ( )

Definition at line 556 of file MessageLogger.cc.

557  {
558  return hostaddr_;
559  }
std::string const & mf::GetHostName ( )

Definition at line 549 of file MessageLogger.cc.

550  {
551  return hostname_;
552  }
std::string const & mf::GetIteration ( )

Definition at line 586 of file MessageLogger.cc.

Referenced by mfplugins::ELsyslog::fillPrefix(), and mf::MaybeLogger_< SEV, VERBATIM >::~MaybeLogger_().

587  {
588  return iteration_;
589  }
std::string const & mf::GetModuleName ( )

Definition at line 607 of file MessageLogger.cc.

Referenced by mf::MaybeLogger_< SEV, VERBATIM >::~MaybeLogger_().

608  {
609  return module_;
610  }
long mf::GetPid ( )

Definition at line 563 of file MessageLogger.cc.

564  {
565  return pid_;
566  }
ostringstream & mf::getStringStream ( std::string const &  psetName)

Definition at line 15 of file stringstream.cc.

References art::errors::Configuration, and mf::priv::streams.

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::isInfoEnabled ( )

Definition at line 627 of file MessageLogger.cc.

628  {
629  return true;
630  }
bool mf::isMessageProcessingSetUp ( )

Definition at line 414 of file MessageLogger.cc.

415  {
416  return isStarted.load();
417  }
bool mf::isWarningEnabled ( )

Definition at line 637 of file MessageLogger.cc.

638  {
639  return true;
640  }
void mf::LogErrorObj ( ErrorObj msg)

Definition at line 421 of file MessageLogger.cc.

References mf::ErrorObj::fullText(), mf::ELseverityLevel::getSymbol(), mf::ELextendedID::id(), mf::ErrorObj::idOverflow(), mf::ErrorObj::is_verbatim(), mf::ELextendedID::severity(), and mf::ErrorObj::xid().

Referenced by mf::MaybeLogger_< SEV, VERBATIM >::~MaybeLogger_().

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

Definition at line 444 of file MessageLogger.cc.

Referenced by art::EventProcessor::endJob().

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

Definition at line 177 of file ELseverityLevel.h.

References mf::ELseverityLevel::cmp().

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

Definition at line 183 of file ELseverityLevel.h.

References mf::ELseverityLevel::cmp().

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.

References mf::ErrorObj::opltlt().

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

Definition at line 214 of file ELseverityLevel.cc.

References mf::ELseverityLevel::getName().

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

Definition at line 275 of file ErrorObj.cc.

References mf::ErrorObj::opltlt().

276  {
277  return e.opltlt(s);
278  }
Float_t e
Definition: plot.C:35
bool mf::operator<= ( ELseverityLevel  e1,
ELseverityLevel  e2 
)
inline

Definition at line 189 of file ELseverityLevel.h.

References mf::ELseverityLevel::cmp().

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

Definition at line 171 of file ELseverityLevel.h.

References mf::ELseverityLevel::cmp().

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

Definition at line 195 of file ELseverityLevel.h.

References mf::ELseverityLevel::cmp().

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

Definition at line 201 of file ELseverityLevel.h.

References mf::ELseverityLevel::cmp().

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

Definition at line 572 of file MessageLogger.cc.

Referenced by lar::standalone::SetupMessageFacility(), and testing::BasicTesterEnvironment< ConfigurationClass >::SetupMessageFacility().

573  {
574  iteration_ = val;
575  }
void mf::SetContextSinglet ( string const &  val)

Definition at line 594 of file MessageLogger.cc.

Referenced by lar::standalone::SetupMessageFacility(), and testing::BasicTesterEnvironment< ConfigurationClass >::SetupMessageFacility().

595  {
596  module_ = val;
597  }
void mf::SetHostAddr ( string const &  hostaddr)

Definition at line 528 of file MessageLogger.cc.

529  {
530  hostaddr_ = hostaddr;
531  }
void mf::SetHostName ( string const &  hostname)

Definition at line 521 of file MessageLogger.cc.

522  {
523  hostname_ = hostname;
524  }
void mf::SetIteration ( string const &  val)

Definition at line 580 of file MessageLogger.cc.

Referenced by main(), art::MFSU_0_ARG_UPDATER_DEFN(), art::MFSU_1_ARG_UPDATER_DEFN(), art::MFSU_2_ARG_UPDATER_DEFN(), and art::run_art().

581  {
582  iteration_ = val;
583  }
void mf::SetModuleName ( string const &  val)

Definition at line 601 of file MessageLogger.cc.

Referenced by art::MFSU_0_ARG_UPDATER_DEFN(), art::MFSU_1_ARG_UPDATER_DEFN(), and art::MFSU_2_ARG_UPDATER_DEFN().

602  {
603  module_ = val;
604  }
void mf::SetPid ( long const  pid)

Definition at line 535 of file MessageLogger.cc.

536  {
537  pid_ = pid;
538  }
void mf::StartMessageFacility ( fhicl::ParameterSet const &  pset,
string const &  applicationName 
)

Definition at line 458 of file MessageLogger.cc.

References art::errors::Configuration, e, mf::errors::OtherError, and fhicl::detail::validationException::what().

Referenced by main(), art::run_art(), lar::standalone::SetupMessageFacility(), and testing::BasicTesterEnvironment< ConfigurationClass >::SetupMessageFacility().

460  {
461  if (isStarted.load()) {
462  return;
463  }
464 
465  cet::BasicPluginFactory pluginFactory{getPluginPath(), "mfPlugin"};
466  cet::BasicPluginFactory pluginStatsFactory{getPluginPath(),
467  "mfStatsPlugin"};
468 
469  // FIXME: We should not have to call StartMessageFacility() to get these
470  // initialized!
471  initGlobalVars(applicationName);
472  try {
473  destinations_["cerr_early"s] = makePlugin_(
474  pluginFactory, "cerr", "cerr_early", default_destination_config());
475  }
476  catch (fhicl::detail::validationException const& e) {
477  string msg{"\nConfiguration error for destination: " +
478  cet::bold_fontify("cerr_early") + "\n\n"};
479  msg += e.what();
480  throw Exception(errors::Configuration) << msg;
481  }
482  try {
483  // Note: We make all the destinations here.
484  configure(
485  MFDestinationConfig::Config{
486  MFConfig::Parameters{pset}().destinations()},
487  pluginFactory,
488  pluginStatsFactory);
489  }
490  catch (Exception const& ex) {
491  // FIXME: Hardly seems necessary to rethrow just to change the message to
492  // say it was during configure!
494  "Exception from MessageLoggerScribe::configure",
495  ex);
496  }
497  isStarted.store(true);
498  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
char const * what() const noexcept override
Float_t e
Definition: plot.C:35

Variable Documentation

ELslProxy<ELdebugGen> constexpr mf::ELdebug {}

Definition at line 113 of file ELseverityLevel.h.

Referenced by mf::ErrorObj::setSeverity().

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.

Referenced by mf::ErrorObj::setSeverity().

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.

Referenced by mf::ErrorObj::setSeverity().

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.

Referenced by mf::service::ELdestination::flush().

ELslProxy<ELzeroSeverityGen> constexpr mf::ELzeroSeverity {}
struct mf::FinalShutdown mf::ensureShutdown
static
atomic<int> mf::ourSerial {0}
static

Definition at line 18 of file ErrorObj.cc.

Referenced by mf::ErrorObj::set().