CMS 3D CMS Logo

MessageDrop.h
Go to the documentation of this file.
1 #ifndef MessageLogger_MessageDrop_h
2 #define MessageLogger_MessageDrop_h
3 
4 // -*- C++ -*-
5 //
6 // Package: MessageLogger
7 // Class : MessageDrop
8 //
18 //
19 // Original Author: M. Fischler and Jim Kowalkowski
20 // Created: Tues Feb 14 16:38:19 CST 2006
21 //
22 
23 // Framework include files
24 
25 #include "FWCore/Utilities/interface/EDMException.h" // change log 4
28 
29 // system include files
30 
31 #include <string>
32 #include <string_view>
33 
34 // Change log
35 //
36 // 1 mf 5/12/06 initialize debugEnabled to true, to avoid unitialized
37 // data detection in memory checks (and to be safe in
38 // getting enabled output independant of timings)
39 //
40 // 4 mf 2/22/07 static ex_p to have a way to convey exceptions to throw
41 // (this is needed when configuring could lead to an
42 // exception, for example)
43 //
44 // 5 mf 2/22/07 jobreport_name to have a way to convey content
45 // of jobreport option from cmsRun to MessageLogger class
46 //
47 // 6 mf 6/18/07 jobMode to have a way to convey choice of hardwired
48 // MessageLogger defaults
49 //
50 // 7 mf 6/20/08 MessageLoggerScribeIsRunning to let the scribe convey
51 // that it is active.
52 //
53 // 8 cdj 2/08/10 Make debugEnabled, infoEnabled, warningEnabled statics
54 // to avoid overhead of thread specific singleton access
55 // when deciding to keep or throw away messages
56 //
57 // 9 mf 9/23/10 Support for situations where no thresholds are low
58 // enough to react to LogDebug (or info, or warning)
59 //
60 // 10 mf, crj 11/2/10 (see MessageServer/src/MessageLogger.cc change 17)
61 // Support for reducing the string operations done when
62 // moving from one module to the next.
63 //
64 // 11 mf 11/29/10 Snapshot method to preare for invalidation of the
65 // pointers used to hold module context. Supports
66 // surviving throws that cause objects to go out of scope.
67 //
68 // 12 fwyzard 7/6/11 Add support for discarding LogError-level messages
69 // on a per-module basis (needed at HLT)
70 //
71 // 13 wmtan 11/11/11 Make non-copyable to satisfy Coverity. Would otherwise
72 // need special copy ctor and copy assignment operator.
73 
74 // user include files
75 
76 namespace edm {
77 
78  namespace messagedrop {
79  class StringProducer;
81  class StringProducerPath;
83  } // namespace messagedrop
84 
85  struct MessageDrop {
86  private:
87  MessageDrop(); // change log 10:
88  // moved to cc file
89  MessageDrop(MessageDrop const&) = delete;
90  MessageDrop& operator=(MessageDrop const&) = delete;
91 
92  public:
93  ~MessageDrop(); // change log 10
94  static MessageDrop* instance();
96  void setModuleWithPhase(std::string const& name, std::string const& label, unsigned int moduleID, const char* phase);
97  void setPath(const char* type, std::string const& pathname);
98  void setSinglet(const char* sing);
99  void clear();
100 
101  std::string_view runEvent;
102  unsigned int streamID;
103  bool debugEnabled; // change log 8
104  bool infoEnabled; // change log 8
105  bool warningEnabled; // change log 8
106  bool errorEnabled; // change log 8, 12
107 
108  CMS_THREAD_SAFE static std::string jobMode; // change log 6
109  CMS_THREAD_SAFE static unsigned char messageLoggerScribeIsRunning; // change log 7
110  CMS_THREAD_SAFE static bool debugAlwaysSuppressed; // change log 9
111  CMS_THREAD_SAFE static bool infoAlwaysSuppressed; // change log 9
112  CMS_THREAD_SAFE static bool warningAlwaysSuppressed; // change log 9
113  private:
118  };
119 
120  static const unsigned char MLSCRIBE_RUNNING_INDICATOR = 29; // change log 7
121 
122 } // end of namespace edm
123 
124 #endif // MessageLogger_MessageDrop_h
edm::MessageDrop::spSinglet
edm::propagate_const< messagedrop::StringProducerSinglet * > spSinglet
Definition: MessageDrop.h:116
edm::MessageDrop::warningAlwaysSuppressed
static bool warningAlwaysSuppressed
Definition: MessageDrop.h:112
edm::messagedrop::StringProducer
Definition: MessageDrop.cc:71
edm::MLSCRIBE_RUNNING_INDICATOR
static const unsigned char MLSCRIBE_RUNNING_INDICATOR
Definition: MessageDrop.h:120
BTVHLTOfflineSource_cfi.pathname
pathname
Definition: BTVHLTOfflineSource_cfi.py:28
propagate_const.h
edm::MessageDrop::debugEnabled
bool debugEnabled
Definition: MessageDrop.h:103
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_2018_cff.phase
phase
Definition: HLT_2018_cff.py:5346
edm::MessageDrop::infoAlwaysSuppressed
static bool infoAlwaysSuppressed
Definition: MessageDrop.h:111
EDMException.h
edm::messagedrop::StringProducerWithPhase
Definition: MessageDrop.cc:77
edm::MessageDrop::moduleNameProducer
messagedrop::StringProducer const * moduleNameProducer
Definition: MessageDrop.h:117
edm::propagate_const
Definition: propagate_const.h:32
edm::MessageDrop::warningEnabled
bool warningEnabled
Definition: MessageDrop.h:105
edm::MessageDrop::setModuleWithPhase
void setModuleWithPhase(std::string const &name, std::string const &label, unsigned int moduleID, const char *phase)
Definition: MessageDrop.cc:181
edm::MessageDrop::clear
void clear()
Definition: MessageDrop.cc:200
edm::messagedrop::StringProducerSinglet
Definition: MessageDrop.cc:151
edm::MessageDrop::streamID
unsigned int streamID
Definition: MessageDrop.h:102
edm::MessageDrop::messageLoggerScribeIsRunning
static unsigned char messageLoggerScribeIsRunning
Definition: MessageDrop.h:109
CMS_THREAD_SAFE
#define CMS_THREAD_SAFE
Definition: thread_safety_macros.h:4
edm::MessageDrop::debugAlwaysSuppressed
static bool debugAlwaysSuppressed
Definition: MessageDrop.h:110
edm::MessageDrop::MessageDrop
MessageDrop()
Definition: MessageDrop.cc:163
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::MessageDrop::~MessageDrop
~MessageDrop()
Definition: MessageDrop.cc:175
edm::MessageDrop::spWithPhase
edm::propagate_const< messagedrop::StringProducerWithPhase * > spWithPhase
Definition: MessageDrop.h:114
thread_safety_macros.h
edm::MessageDrop::runEvent
std::string_view runEvent
Definition: MessageDrop.h:101
edm::MessageDrop
Definition: MessageDrop.h:85
edm::MessageDrop::setSinglet
void setSinglet(const char *sing)
Definition: MessageDrop.cc:194
edm::MessageDrop::setPath
void setPath(const char *type, std::string const &pathname)
Definition: MessageDrop.cc:189
edm::MessageDrop::errorEnabled
bool errorEnabled
Definition: MessageDrop.h:106
edm::messagedrop::StringProducerPath
Definition: MessageDrop.cc:124
type
type
Definition: HCALResponse.h:21
edm::MessageDrop::instance
static MessageDrop * instance()
Definition: MessageDrop.cc:60
edm::MessageDrop::moduleContext
std::string moduleContext()
Definition: MessageDrop.cc:199
edm::MessageDrop::spPath
edm::propagate_const< messagedrop::StringProducerPath * > spPath
Definition: MessageDrop.h:115
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::MessageDrop::jobMode
static std::string jobMode
Definition: MessageDrop.h:108
edm::MessageDrop::operator=
MessageDrop & operator=(MessageDrop const &)=delete
label
const char * label
Definition: PFTauDecayModeTools.cc:11
edm::MessageDrop::infoEnabled
bool infoEnabled
Definition: MessageDrop.h:104