LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
MessageLogger.cc
Go to the documentation of this file.
2 // vim: set sw=2 expandtab :
3 
4 #include "cetlib/BasicPluginFactory.h"
5 #include "cetlib/HorizontalRule.h"
6 #include "cetlib/container_algorithms.h"
7 #include "cetlib/exempt_ptr.h"
8 #include "cetlib/os_libpath.h"
9 #include "cetlib/propagate_const.h"
10 #include "cetlib/trim.h"
11 #include "fhiclcpp/ParameterSet.h"
15 #include "hep_concurrency/RecursiveMutex.h"
24 
25 #include <algorithm>
26 #include <atomic>
27 #include <cassert>
28 #include <cstdlib>
29 #include <fstream>
30 #include <iosfwd>
31 #include <iostream>
32 #include <map>
33 #include <memory>
34 //#include <mutex>
35 #include <sstream>
36 #include <string>
37 #include <type_traits>
38 #include <utility>
39 #include <vector>
40 
41 #include <arpa/inet.h>
42 #include <ifaddrs.h>
43 #include <netdb.h>
44 #include <netinet/in.h>
45 
46 using namespace std;
47 using namespace std::string_literals;
48 using namespace hep::concurrency;
49 
50 namespace mf {
51  namespace service {
52 
53  namespace ELdestConfig {
54 
56 
57  } // namespace ELdestConfig
58 
59  } // namespace service
60 } // namespace mf
61 
62 namespace mf {
63 
64  namespace {
65 
66  cet::search_path
67  getPluginPath()
68  {
69  if (getenv("MF_PLUGIN_PATH") != nullptr) {
70  return cet::search_path{"MF_PLUGIN_PATH"};
71  }
72  return cet::search_path{cet::os_libpath()};
73  }
74 
75  cet::BasicPluginFactory pluginFactory_{getPluginPath(), "mfPlugin"};
76  cet::BasicPluginFactory pluginStatsFactory_{getPluginPath(),
77  "mfStatsPlugin"};
78  atomic<bool> isStarted{false};
79  map<string const, unique_ptr<service::ELdestination>> destinations_;
80  bool cleanSlateConfiguration_{true};
81  atomic<bool> purgeMode_{false};
82  atomic<int> count_{0};
83  // atomic<bool> messageBeingSent_{false};
84  // atomic<bool> waitingMessagesBusy_{false};
85  // mutex msgMutex_;
86  RecursiveMutex msgMutex_{"MessageLogger::msgMutex_"};
87  string hostname_;
88  string hostaddr_;
89  string application_;
90  long pid_{};
91 
92  // Any text you want. It goes into the message header in the module
93  // position.
94  thread_local string module_ = "Early";
95 
96  // Kind of pointless, arbitrarily set to an alternate spelling of
97  // the phase, or the {run|subrun|event} number by art::MFStatusUpdater.
98  // FIXME: The statistics gatherer attempts to parse this!
99  thread_local string iteration_ = "pre-events";
100 
101  int
102  initGlobalVars(string const& applicationName = "")
103  {
104  char hostname[1024] = {0};
105  hostname_ =
106  (gethostname(hostname, 1023) == 0) ? hostname : "Unknown Host";
107  hostent* host = nullptr;
108  host = gethostbyname(hostname);
109  if (host != nullptr) {
110  // Host lookup succeeded.
111  char* ip = inet_ntoa(*(struct in_addr*)host->h_addr);
112  hostaddr_ = ip;
113  } else {
114  // Loop over all network interfaces and use the first non-loopback
115  // address found.
116  ifaddrs* ifAddrStruct = nullptr;
117  if (getifaddrs(&ifAddrStruct)) {
118  // Failed, use the loopback address.
119  hostaddr_ = "127.0.0.1";
120  } else {
121  // Loop over all interfaces.
122  for (ifaddrs* ifa = ifAddrStruct; ifa != nullptr;
123  ifa = ifa->ifa_next) {
124  if (ifa->ifa_addr->sa_family == AF_INET) {
125  // This interface has a valid IPv4 address.
126  void* tmpAddrPtr = &((sockaddr_in*)ifa->ifa_addr)->sin_addr;
127  char addressBuffer[INET_ADDRSTRLEN];
128  inet_ntop(AF_INET, tmpAddrPtr, addressBuffer, INET_ADDRSTRLEN);
129  hostaddr_ = addressBuffer;
130  } else if (ifa->ifa_addr->sa_family == AF_INET6) {
131  // This interface has a valid IPv6 address.
132  void* tmpAddrPtr = &((sockaddr_in6*)ifa->ifa_addr)->sin6_addr;
133  char addressBuffer[INET6_ADDRSTRLEN];
134  inet_ntop(AF_INET6, tmpAddrPtr, addressBuffer, INET6_ADDRSTRLEN);
135  hostaddr_ = addressBuffer;
136  }
137  // Use the address if it is not a loopback address.
138  if (!hostaddr_.empty() && hostaddr_.compare("127.0.0.1") &&
139  hostaddr_.compare("::1")) {
140  break;
141  }
142  }
143  if (hostaddr_.empty()) {
144  // Failed to find anything, use the loopback address.
145  hostaddr_ = "127.0.0.1";
146  }
147  }
148  }
149  if (!applicationName.empty()) {
150  application_ = applicationName;
151  } else {
152  // get process name from '/proc/pid/cmdline'
153  stringstream ss;
154  ss << "//proc//" << pid_ << "//cmdline";
155  ifstream procfile{ss.str().c_str()};
156  string procinfo;
157  if (procfile.is_open()) {
158  // FIXME: This can fail with ERETRY!
159  procfile >> procinfo;
160  procfile.close();
161  }
162  auto end = procinfo.find('\0');
163  auto start = procinfo.find_last_of('/', end);
164  application_ = procinfo.substr(start + 1, end - start - 1);
165  }
166  pid_ = static_cast<long>(getpid());
167  return 0;
168  }
169 
170  // FIXME: Do not want to read from /proc/pid/cmdline if we do not have to!
171  // static int globalsInitializer = initGlobalVars();
172 
173  } // unnamed namespace
174 
175  namespace {
176 
177  unique_ptr<service::ELdestination>
178  makePlugin_(cet::BasicPluginFactory& plugin_factory,
179  string const& libspec,
180  string const& psetname,
181  fhicl::ParameterSet const& pset)
182  {
183  unique_ptr<service::ELdestination> result;
184  try {
185  auto const pluginType = plugin_factory.pluginType(libspec);
186  if (pluginType ==
188  result =
189  plugin_factory.makePlugin<unique_ptr<service::ELdestination>>(
190  libspec, psetname, pset);
191  } else {
192  throw Exception(errors::Configuration, "MessageLoggerScribe: ")
193  << "unrecognized plugin type " << pluginType << "for plugin "
194  << libspec << ".\n";
195  }
196  }
197  catch (cet::exception const& e) {
198  throw Exception(errors::Configuration, "MessageLoggerScribe: ", e)
199  << "Exception caught while processing plugin spec.\n";
200  }
201  return result;
202  }
203 
204  string const default_destination_config_string = " type: cerr"
205  " categories: {"
206  " default: {"
207  " limit: -1"
208  " }"
209  " }"s;
210 
212  default_destination_config()
213  {
214  fhicl::ParameterSet result;
215  fhicl::make_ParameterSet(default_destination_config_string, result);
216  return result;
217  }
218 
220  default_destination_set_config()
221  {
222  string const config{"cerr: { "s + default_destination_config_string +
223  " }"s};
224  fhicl::ParameterSet result;
225  fhicl::make_ParameterSet(config, result);
226  return result;
227  }
228 
229  void
230  sendMsgToDests(
231  ErrorObj& msg,
232  map<string const, unique_ptr<service::ELdestination>>& destinations)
233  {
234  if (msg.xid().hostname().empty()) {
235  msg.setHostName(GetHostName());
236  }
237  if (msg.xid().hostaddr().empty()) {
238  msg.setHostAddr(GetHostAddr());
239  }
240  if (msg.xid().application().empty()) {
242  }
243  if (msg.xid().pid() == 0) {
244  msg.setPID(GetPid());
245  }
246  if (destinations.empty()) {
247  cerr << "\nERROR LOGGED WITHOUT DESTINATION!\nAttaching destination "
248  "\"cerr\" by default\n\n";
249  destinations.emplace(
250  "cerr",
251  make_unique<service::ELostreamOutput>(
252  default_destination_set_config(), cet::ostream_handle{cerr}));
253  }
254  for (auto& destid_and_destination : destinations) {
255  destid_and_destination.second->log(msg);
256  }
257  }
258 
259  void
260  makeDestinations(fhicl::ParameterSet const& dests,
261  service::ELdestConfig::dest_config const configuration)
262  {
263  set<string> ids;
264  vector<string> config_errors;
265  for (auto const& psetname : dests.get_pset_names()) {
266  auto dest_pset = dests.get<fhicl::ParameterSet>(psetname);
267  if (dest_pset.is_empty()) {
268  dest_pset = default_destination_config();
269  }
270  // Grab the destination type and filename.
271  string dest_type{};
272  if (!dest_pset.get_if_present("type", dest_type)) {
274  << "No 'type' specified for destination '" << psetname << "'.\n";
275  }
276  if (configuration == service::ELdestConfig::STATISTICS) {
277  if ((dest_type != "cout"s) && (dest_type != "cerr"s) &&
278  (dest_type != "file"s)) {
280  << "\n"
281  << "Unsupported type [ " << dest_type
282  << " ] chosen for statistics printout.\n"
283  << "Must choose ostream type: \"cout\", \"cerr\", or \"file\""
284  << "\n";
285  }
286  }
287  string outputId{dest_type};
288  if ((dest_type != "cout"s) && (dest_type != "cerr"s) &&
289  (dest_type != "syslog"s)) {
290  outputId += ":" + dest_pset.get<string>("filename", psetname);
291  }
292  if (!ids.emplace(outputId).second) {
293  // We have a duplicate.
294  if (configuration == service::ELdestConfig::STATISTICS) {
296  << "\n"
297  << " Output identifier: \"" << outputId << "\""
298  << " already specified within ordinary/statistics block in FHiCL "
299  "file"
300  << "\n";
301  }
302  }
303  auto iter_id_dest = destinations_.find(outputId);
304  if (iter_id_dest != destinations_.end()) {
305  string const hrule{"\n==============================================="
306  "============================= \n"};
307  ostringstream except_msg;
308  except_msg << hrule << "\n Duplicate name for a ";
309  if (configuration == service::ELdestConfig::ORDINARY) {
310  except_msg << "MessageLogger";
311  } else {
312  except_msg << "MessageLogger Statistics";
313  }
314  except_msg << " destination: \"" << outputId << '"';
315  ostringstream orig_config_msg;
316  orig_config_msg
317  << "\n Only original configuration instructions are used. \n"
318  << hrule;
319  if (cleanSlateConfiguration_) {
320  LogError("duplicateDestination")
321  << except_msg.str() << orig_config_msg.str();
322  } else {
323  LogWarning("duplicateDestination")
324  << except_msg.str() << orig_config_msg.str();
325  }
326  continue;
327  }
328  string const& libspec = dest_type;
329  auto& plugin_factory =
330  (configuration == service::ELdestConfig::STATISTICS) ?
331  pluginStatsFactory_ :
332  pluginFactory_;
333  try {
334  destinations_[outputId] =
335  makePlugin_(plugin_factory, libspec, psetname, dest_pset);
336  }
337  catch (fhicl::detail::validationException const& e) {
338  string msg{"Configuration error for destination: " +
339  detail::bold_fontify(psetname) + "\n\n"};
340  msg += e.what();
341  config_errors.push_back(move(msg));
342  }
343  }
344  if (!config_errors.empty()) {
345  string msg{"\nThe following messagefacility destinations have "
346  "configuration errors:\n\n"};
347  constexpr cet::HorizontalRule rule{60};
348  msg += rule('=');
349  msg += "\n\n";
350  auto start = cbegin(config_errors);
351  msg += *start;
352  ++start;
353  for (auto it = start, e = cend(config_errors); it != e; ++it) {
354  msg += rule('-');
355  msg += "\n\n";
356  msg += *it;
357  }
358  msg += rule('=');
359  msg += "\n\n";
360  throw Exception(errors::Configuration) << msg;
361  }
362  }
363 
364  void
365  configure(MFDestinationConfig::Config const& config)
366  {
367  if (destinations_.size() > 1) {
368  LogWarning("multiLogConfig")
369  << "The message logger has been configured multiple times";
370  cleanSlateConfiguration_ = false;
371  }
372  fhicl::ParameterSet dest_psets;
373  fhicl::ParameterSet ordinaryDests;
374  if (!config.destinations.get_if_present(dest_psets)) {
375  dest_psets = default_destination_set_config();
376  }
377  ordinaryDests = dest_psets;
378  ordinaryDests.erase("statistics");
379  // Dial down the early destination once the ordinary destinations are
380  // filled.
381  destinations_["cerr_early"s]->setThreshold(ELhighestSeverity);
382  fhicl::ParameterSet default_statistics_config;
383  if (ordinaryDests.is_empty()) {
384  string const default_config{"file_stats: {\n"
385  " type: file\n"
386  " filename: \"err.log\"\n"
387  " threshold: WARNING\n"
388  "}\n"};
389  fhicl::make_ParameterSet(default_config, default_statistics_config);
390  }
391  makeDestinations(ordinaryDests, service::ELdestConfig::ORDINARY);
392  auto statDests = dest_psets.get<fhicl::ParameterSet>(
393  "statistics", default_statistics_config);
394  makeDestinations(statDests, service::ELdestConfig::STATISTICS);
395  }
396 
397  void
398  logMessage(ErrorObj* msg)
399  {
400  if (purgeMode_) {
401  // We are dropping all messages due to an earlier exception.
402  delete msg;
403  return;
404  }
405  // bool expected = false;
406  // while (!messageBeingSent_.compare_exchange_strong(expected, true)) {
407  // // Some other thread is already processing a message,
408  // // so if the queue is not being emptied right now, append
409  // // this message to the queue and return, otherwise, wait
410  // // for the empty cycle to finish, and retry.
411  // bool waiting_expected = false;
412  // if (waitingMessagesBusy_.compare_exchange_strong(waiting_expected,
413  // true)) {
414  // // The thread which is already processing messages has not
415  // // begun emptying the waiting message queue yet, we can add
416  // // our message to the queue and return.
417  // waitingMessages_.push(msg);
418  // waitingMessagesBusy_.store(false);
419  // return;
420  // }
421  // waiting_expected = false;
422  // // The thread which is already processing messages has begun
423  // // to empty the waiting message queue, let him do that by spin
424  // // waiting, with a hardware pause of about 40 cycles between spins.
425  // while (!waitingMessagesBusy_.compare_exchange_strong(waiting_expected,
426  // true)) {
427  // asm volatile("pause\n" : : : "memory");
428  // waiting_expected = false;
429  // }
430  // waitingMessagesBusy_.store(false);
431  // // Other guy has finished emptying the queue and released
432  // // messageBeingSent_ too. We may now compete with other threads
433  // // to set messageBeingSent_. If we fail, we will try to queue
434  // // the message again.
435  // expected = false;
436  //}
437  // lock_guard<mutex> blocker(msgMutex_);
438  RecursiveMutexSentry sentry{msgMutex_, __func__};
439  // Ok, no other thread active, process the current message.
440  try {
441  unique_ptr<ErrorObj> msgHolder{msg};
442  msg->setReactedTo(false);
443  sendMsgToDests(*msg, destinations_);
444  }
445  catch (cet::exception const& e) {
446  ++count_;
447  cerr << "MessageLoggerScribe caught " << count_
448  << " cet::exceptions, text = \n"
449  << e.what() << "\n";
450  if (count_ > 25) {
451  cerr << "MessageLogger will no longer be processing messages due to "
452  "errors (entering purge mode).\n";
453  purgeMode_ = true;
454  }
455  }
456  catch (...) {
457  cerr << "MessageLoggerScribe caught an unknown exception and will no "
458  "longer be processing messages. (entering purge mode)\n";
459  purgeMode_ = true;
460  }
462  // unique_ptr<ErrorObj> waiting_msgHolder;
463  // ErrorObj* waiting_msg = nullptr;
467  // bool waiting_expected = false;
471  // while (!waitingMessagesBusy_.compare_exchange_strong(waiting_expected,
472  // true)) {
473  // asm volatile("pause\n" : : : "memory");
474  // waiting_expected = false;
475  //}
476  // while (waitingMessages_.try_pop(waiting_msg)) {
477  // if (purgeMode_) {
478  // delete waiting_msg;
479  // waiting_msg = nullptr;
480  // continue;
481  // }
482  // try {
483  // waiting_msgHolder.reset(waiting_msg);
484  // waiting_msg->setReactedTo(false);
485  // sendMsgToDests(*waiting_msg, destinations_);
486  // }
487  // catch (cet::exception const& e) {
488  // ++count_;
489  // cerr << "MessageLoggerScribe caught " << count_ << "
490  // cet::exceptions, text = \n" << e.what() << "\n"; if (count_ > 25) {
491  // cerr << "MessageLogger will no longer be processing messages due
492  // to errors (entering purge mode).\n"; purgeMode_ = true;
493  // }
494  // }
495  // catch (...) {
496  // cerr << "MessageLoggerScribe caught an unknown exception and will no
497  // longer be processing messages. (entering purge mode)\n"; purgeMode_
498  // = true;
499  // }
500  //}
503  // messageBeingSent_.store(false);
511  // waitingMessagesBusy_.store(false);
512  }
513 
514  void
515  summarize()
516  {
517  try {
518  for (auto& destid_and_dest : destinations_) {
519  auto& dest = *destid_and_dest.second;
520  dest.summary();
521  }
522  }
523  catch (cet::exception const& e) {
524  cerr << "MessageLoggerScribe caught exception during summarize:\n"
525  << e.what() << "\n";
526  }
527  catch (...) {
528  cerr << "MessageLoggerScribe caught unknown exception type during "
529  "summarize. (Ignored)\n";
530  }
531  }
532 
533  } // unnamed namespace
534 
535  // Note: Safe to call from multiple threads.
536  bool
538  {
539  return isStarted.load();
540  }
541 
542  // Note: Safe to call from multiple threads.
543  void
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  }
564 
565  // Note: Call this from single-threaded mode only!
566  void
568  {
569  if (isStarted.load()) {
570  summarize();
571  }
572  }
573 
574  // Note: Obsolete! Remove when user code migrated.
575  void
577  {}
578 
579  // Note: Call this from single-threaded mode only!
580  void
582  string const& applicationName)
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  }
614 
615  // Note: Call this from single-threaded mode only!
616  void
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  }
639 
640  // Note: Call this from single-threaded mode only!
641  void
642  SetApplicationName(string const& applicationName)
643  {
644  application_ = applicationName;
645  }
646 
647  // Note: Call this from single-threaded mode only!
648  void
649  SetHostName(string const& hostname)
650  {
651  hostname_ = hostname;
652  }
653 
654  // Note: Call this from single-threaded mode only!
655  void
656  SetHostAddr(string const& hostaddr)
657  {
658  hostaddr_ = hostaddr;
659  }
660 
661  // Note: Call this from single-threaded mode only!
662  void
663  SetPid(long pid)
664  {
665  pid_ = pid;
666  }
667 
668  // Note: Call this from single-threaded mode only!
669  string const&
671  {
672  return application_;
673  }
674 
675  // Note: Call this from single-threaded mode only!
676  string const&
678  {
679  return hostname_;
680  }
681 
682  // Note: Call this from single-threaded mode only!
683  string const&
685  {
686  return hostaddr_;
687  }
688 
689  // Note: Call this from single-threaded mode only!
690  long
692  {
693  return pid_;
694  }
695 
696  // Phase or {run|subrun|event} number.
697  // Note: Obsolete! Remove when user code migrated.
698  // Note: This is thread specific and thread safe.
699  void
700  SetContextIteration(string const& val)
701  {
702  iteration_ = val;
703  }
704 
705  // Phase or {run|subrun|event} number.
706  // Note: This is thread specific and thread safe.
707  void
708  SetIteration(string const& val)
709  {
710  iteration_ = val;
711  }
712 
713  string const&
715  {
716  return iteration_;
717  }
718 
719  // Note: Obsolete! Remove when user code migrated.
720  // Note: This is thread specific and thread safe.
721  void
722  SetContextSinglet(string const& val)
723  {
724  module_ = val;
725  }
726 
727  // Note: This is thread specific and thread safe.
728  void
729  SetModuleName(string const& val)
730  {
731  module_ = val;
732  }
733 
734  string const&
736  {
737  return module_;
738  }
739 
740  // Note: Call this from single-threaded mode only!
741  // FIXME: This does not give the same answer as before because it is no longer
742  // per-module!
743  // Note: Obsolete! Remove when user code migrated.
744  bool
746  {
747  return false;
748  }
749 
750  // Note: Call this from single-threaded mode only!
751  // FIXME: This does not give the same answer as before because it is no longer
752  // per-module!
753  // Note: Obsolete! Remove when user code migrated.
754  bool
756  {
757  return true;
758  }
759 
760  // Note: Call this from single-threaded mode only!
761  // FIXME: This does not give the same answer as before because it is no longer
762  // per-module!
763  // Note: Obsolete! Remove when user code migrated.
764  bool
766  {
767  return true;
768  }
769 
770  // This static global will be destroyed before any other
771  // file-local or global variables when this dll is unloaded
772  // (because it is the last in the file), and will take care
773  // of cleanup if the user forgot to call EndMessageFacility().
774  static struct FinalShutdown {
776  {
777  if (isStarted.load()) {
779  }
780  }
781  } ensureShutdown;
782 
783 } // namespace mf
std::string bold_fontify(std::string const &s)
Definition: bold_fontify.h:9
fhicl::OptionalDelegatedParameter destinations
Definition: MFConfig.h:23
Float_t s
Definition: plot.C:23
ELseverityLevel severity() const
Definition: ELextendedID.cc:33
void SetIteration(string const &val)
void SetHostAddr(string const &hostaddr)
void EndMessageFacility()
std::string const & application() const
Definition: ELextendedID.cc:63
virtual void setPID(long)
Definition: ErrorObj.cc:201
Float_t ss
Definition: plot.C:23
string const & GetModuleName()
STL namespace.
void make_ParameterSet(intermediate_table const &tbl, ParameterSet &ps)
static struct mf::FinalShutdown ensureShutdown
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
ELslProxy< ELhighestSeverityGen > constexpr ELhighestSeverity
void FlushMessageLog()
virtual void setHostName(std::string const &)
Definition: ErrorObj.cc:183
void SetContextIteration(string const &val)
bool is_verbatim() const
Definition: ErrorObj.cc:91
cet::coded_exception< errors::error, detail::translate > Exception
Definition: exception.h:16
std::string const & idOverflow() const
Definition: ErrorObj.cc:67
bool isMessageProcessingSetUp()
std::vector< std::string > get_pset_names() const
void StartMessageFacility(fhicl::ParameterSet const &pset, string const &applicationName)
bool isWarningEnabled()
void SetPid(long pid)
std::string const & hostaddr() const
Definition: ELextendedID.cc:57
bool isInfoEnabled()
ELextendedID const & xid() const
Definition: ErrorObj.cc:61
T get(std::string const &key) const
Definition: ParameterSet.h:231
bool isDebugEnabled()
virtual void setHostAddr(std::string const &)
Definition: ErrorObj.cc:189
std::string const & id() const
Definition: ELextendedID.cc:27
std::string fullText() const
Definition: ErrorObj.cc:110
virtual void setApplication(std::string const &)
Definition: ErrorObj.cc:195
void LogStatistics()
void SetHostName(string const &hostname)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
string const & GetHostName()
bool is_empty() const
Definition: ParameterSet.cc:97
char const * what() const noexcept override
std::string value(boost::any const &)
string const & GetIteration()
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void SetContextSinglet(string const &val)
virtual void setReactedTo(bool)
Definition: ErrorObj.cc:177
bool erase(std::string const &key)
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
void LogErrorObj(ErrorObj *msg)
long pid() const
Definition: ELextendedID.cc:69
Float_t e
Definition: plot.C:34
void SetModuleName(string const &val)
void SetApplicationName(string const &applicationName)
std::string const & hostname() const
Definition: ELextendedID.cc:51
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::string getSymbol() const
string const & GetApplicationName()
string const & GetHostAddr()
long GetPid()