LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
mf Namespace Reference

Namespaces

 detail
 
 errors
 
 service
 

Classes

class  ELextendedID
 
class  ELseverityLevel
 
struct  ELslProxy
 
class  ErrorObj
 
struct  file_mfPluginConfig
 
struct  file_mfStatsPluginConfig
 
struct  FinalShutdown
 
class  MaybeLogger_
 
class  MessageFacilityMsg
 
class  MFConfig
 
class  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 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 11 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 222 of file MessageLogger.h.

Definition at line 211 of file MessageLogger.h.

Definition at line 214 of file MessageLogger.h.

Definition at line 212 of file MessageLogger.h.

Definition at line 220 of file MessageLogger.h.

Definition at line 221 of file MessageLogger.h.

Definition at line 215 of file MessageLogger.h.

Definition at line 218 of file MessageLogger.h.

Definition at line 219 of file MessageLogger.h.

Definition at line 213 of file MessageLogger.h.

Function Documentation

ELseverityLevel constexpr mf::ELdebugGen ( )
inline

Definition at line 76 of file ELseverityLevel.h.

References mf::ELseverityLevel::ELsev_success.

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

Definition at line 91 of file ELseverityLevel.h.

References mf::ELseverityLevel::ELsev_error.

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

Definition at line 106 of file ELseverityLevel.h.

References mf::ELseverityLevel::ELsev_highestSeverity.

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

Definition at line 81 of file ELseverityLevel.h.

References mf::ELseverityLevel::ELsev_info.

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

Definition at line 101 of file ELseverityLevel.h.

References mf::ELseverityLevel::ELsev_severe.

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

Definition at line 71 of file ELseverityLevel.h.

References mf::ELseverityLevel::ELsev_success.

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

Definition at line 96 of file ELseverityLevel.h.

References mf::ELseverityLevel::ELsev_unspecified.

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

Definition at line 86 of file ELseverityLevel.h.

References mf::ELseverityLevel::ELsev_warning.

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

Definition at line 66 of file ELseverityLevel.h.

References mf::ELseverityLevel::ELsev_zeroSeverity.

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

Definition at line 617 of file MessageLogger.cc.

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

618  {
619  isStarted.store(false);
620  // If there are any waiting messages, finish them off.
621  // FIXME: The code has been changed to make this case impossible, remove!
622  // FIXME: We need to disable sending any more while we are tying to empty
623  // the queue!
624  // ErrorObj* msg = nullptr;
625  // while (waitingMessages_.try_pop(msg)) {
626  // if (!purgeMode_) {
627  // msg->setReactedTo(false);
628  // sendMsgToDests(*msg, destinations_);
629  // }
630  // delete msg;
631  //}
632  // FIXME: The finish() call in all known uses does nothing, the destination
633  // dtor can probably handle this, remove!
634  // map<string, cet::propagate_const<unique_ptr<service::ELdestination>>>
635  for (auto& category_and_destination : destinations_) {
636  category_and_destination.second->finish();
637  }
638  }
void mf::FlushMessageLog ( )

Definition at line 576 of file MessageLogger.cc.

Referenced by art::detail::logFileAction().

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

Definition at line 670 of file MessageLogger.cc.

671  {
672  return application_;
673  }
std::string const & mf::GetHostAddr ( )

Definition at line 684 of file MessageLogger.cc.

685  {
686  return hostaddr_;
687  }
std::string const & mf::GetHostName ( )

Definition at line 677 of file MessageLogger.cc.

678  {
679  return hostname_;
680  }
std::string const & mf::GetIteration ( )

Definition at line 714 of file MessageLogger.cc.

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

715  {
716  return iteration_;
717  }
std::string const & mf::GetModuleName ( )

Definition at line 735 of file MessageLogger.cc.

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

736  {
737  return module_;
738  }
long mf::GetPid ( )

Definition at line 691 of file MessageLogger.cc.

692  {
693  return pid_;
694  }
ostringstream & mf::getStringStream ( std::string const &  psetName)

Definition at line 29 of file stringstream_mfPlugin.cc.

References art::errors::Configuration.

30 {
31  auto const I = streams.find(psetName);
32  if (I != streams.end()) {
33  return dynamic_cast<ostringstream&>(static_cast<ostream&>(I->second));
34  }
35  throw Exception(errors::Configuration, "mf::getStringStream:")
36  << "Unable to find specified messagefacility logging stream \"" << psetName
37  << ":\" please ensure it has been configured as a destination.";
38 }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
bool mf::isInfoEnabled ( )

Definition at line 755 of file MessageLogger.cc.

756  {
757  return true;
758  }
bool mf::isMessageProcessingSetUp ( )

Definition at line 537 of file MessageLogger.cc.

538  {
539  return isStarted.load();
540  }
bool mf::isWarningEnabled ( )

Definition at line 765 of file MessageLogger.cc.

766  {
767  return true;
768  }
void mf::LogErrorObj ( ErrorObj msg)

Definition at line 544 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_().

545  {
546  if (isStarted.load()) {
547  logMessage(msg);
548  return;
549  }
550  if (msg->is_verbatim()) {
551  ostringstream buf;
552  buf << msg->fullText() << '\n';
553  cerr << buf.str();
554  } else {
555  ostringstream buf;
556  buf << "%MSG" << msg->xid().severity().getSymbol() << ' '
557  << msg->xid().id() << msg->idOverflow() << ": \n"
558  << msg->fullText() << "\n"
559  << "%MSG\n";
560  cerr << buf.str();
561  }
562  delete msg;
563  }
void mf::LogStatistics ( )

Definition at line 567 of file MessageLogger.cc.

568  {
569  if (isStarted.load()) {
570  summarize();
571  }
572  }
bool mf::operator!= ( ELseverityLevel  e1,
ELseverityLevel  e2 
)
inline

Definition at line 176 of file ELseverityLevel.h.

References mf::ELseverityLevel::cmp().

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

Definition at line 182 of file ELseverityLevel.h.

References mf::ELseverityLevel::cmp().

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

Definition at line 115 of file ErrorObj.h.

References mf::ErrorObj::opltlt().

116  {
117  return e.opltlt(t);
118  }
Float_t e
Definition: plot.C:34
ostream& mf::operator<< ( std::ostream &  os,
ELseverityLevel const  sev 
)

Definition at line 213 of file ELseverityLevel.cc.

References mf::ELseverityLevel::getName().

214  {
215  return os << " -" << sev.getName() << "- ";
216  }
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 s
Definition: plot.C:23
Float_t e
Definition: plot.C:34
bool mf::operator<= ( ELseverityLevel  e1,
ELseverityLevel  e2 
)
inline

Definition at line 188 of file ELseverityLevel.h.

References mf::ELseverityLevel::cmp().

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

Definition at line 170 of file ELseverityLevel.h.

References mf::ELseverityLevel::cmp().

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

Definition at line 194 of file ELseverityLevel.h.

References mf::ELseverityLevel::cmp().

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

Definition at line 200 of file ELseverityLevel.h.

References mf::ELseverityLevel::cmp().

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

Definition at line 700 of file MessageLogger.cc.

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

701  {
702  iteration_ = val;
703  }
void mf::SetContextSinglet ( string const &  val)

Definition at line 722 of file MessageLogger.cc.

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

723  {
724  module_ = val;
725  }
void mf::SetHostAddr ( string const &  hostaddr)

Definition at line 656 of file MessageLogger.cc.

657  {
658  hostaddr_ = hostaddr;
659  }
void mf::SetHostName ( string const &  hostname)

Definition at line 649 of file MessageLogger.cc.

650  {
651  hostname_ = hostname;
652  }
void mf::SetIteration ( string const &  val)

Definition at line 708 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_common_().

709  {
710  iteration_ = val;
711  }
void mf::SetModuleName ( string const &  val)

Definition at line 729 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().

730  {
731  module_ = val;
732  }
void mf::SetPid ( long  pid)

Definition at line 663 of file MessageLogger.cc.

664  {
665  pid_ = pid;
666  }
void mf::StartMessageFacility ( fhicl::ParameterSet const &  pset,
string const &  applicationName 
)

Definition at line 581 of file MessageLogger.cc.

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

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

583  {
584  if (isStarted.load()) {
585  return;
586  }
587  // FIXME: We should not have to call StartMessageFacility() to get these
588  // initialized!
589  initGlobalVars(applicationName);
590  try {
591  destinations_["cerr_early"s] = makePlugin_(
592  pluginFactory_, "cerr", "cerr_early", default_destination_config());
593  }
594  catch (fhicl::detail::validationException const& e) {
595  string msg{"\nConfiguration error for destination: " +
596  detail::bold_fontify("cerr_early") + "\n\n"};
597  msg += e.what();
598  throw Exception(errors::Configuration) << msg;
599  }
600  try {
601  // Note: We make all the destinations here.
602  configure(MFDestinationConfig::Config{
603  MFConfig::Parameters{pset}().destinations()});
604  }
605  catch (Exception const& ex) {
606  // FIXME: Hardly seems necessary to rethrow just to change the message to
607  // say it was during configure!
609  "Exception from MessageLoggerScribe::configure",
610  ex);
611  }
612  isStarted.store(true);
613  }
std::string bold_fontify(std::string const &s)
Definition: bold_fontify.h:9
Float_t s
Definition: plot.C:23
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
char const * what() const noexcept override
Float_t e
Definition: plot.C:34

Variable Documentation

ELslProxy<ELdebugGen> constexpr mf::ELdebug {}

Definition at line 112 of file ELseverityLevel.h.

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

ELslProxy<ELerrorGen> constexpr mf::ELerror {}

Definition at line 116 of file ELseverityLevel.h.

ELslProxy<ELhighestSeverityGen> constexpr mf::ELhighestSeverity {}

Definition at line 119 of file ELseverityLevel.h.

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

ELslProxy<ELinfoGen> constexpr mf::ELinfo {}

Definition at line 114 of file ELseverityLevel.h.

ELslProxy<ELsevereGen> constexpr mf::ELsevere {}

Definition at line 118 of file ELseverityLevel.h.

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

ELslProxy<ELsuccessGen> constexpr mf::ELsuccess {}

Definition at line 113 of file ELseverityLevel.h.

ELslProxy<ELunspecifiedGen> constexpr mf::ELunspecified {}

Definition at line 117 of file ELseverityLevel.h.

ELslProxy<ELwarningGen> constexpr mf::ELwarning {}

Definition at line 115 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().