00001 #ifndef MessageLogger_MessageDrop_h 00002 #define MessageLogger_MessageDrop_h 00003 00004 // -*- C++ -*- 00005 // 00006 // Package: MessageLogger 00007 // Class : MessageDrop 00008 // 00018 // 00019 // Original Author: M. Fischler and Jim Kowalkowski 00020 // Created: Tues Feb 14 16:38:19 CST 2006 00021 // $Id: MessageDrop.h,v 1.16 2011/06/07 22:24:31 fwyzard Exp $ 00022 // 00023 00024 // Framework include files 00025 00026 #include "FWCore/Utilities/interface/EDMException.h" // change log 4 00027 00028 00029 // system include files 00030 00031 #include <string> 00032 00033 // Change log 00034 // 00035 // 1 mf 5/12/06 initialize debugEnabled to true, to avoid unitialized 00036 // data detection in memory checks (and to be safe in 00037 // getting enabled output independant of timings) 00038 // 00039 // 4 mf 2/22/07 static ex_p to have a way to convey exceptions to throw 00040 // (this is needed when configuring could lead to an 00041 // exception, for example) 00042 // 00043 // 5 mf 2/22/07 jobreport_name to have a way to convey content 00044 // of jobreport option from cmsRun to MessageLogger class 00045 // 00046 // 6 mf 6/18/07 jobMode to have a way to convey choice of hardwired 00047 // MessageLogger defaults 00048 // 00049 // 7 mf 6/20/08 MessageLoggerScribeIsRunning to let the scribe convey 00050 // that it is active. 00051 // 00052 // 8 cdj 2/08/10 Make debugEnabled, infoEnabled, warningEnabled statics 00053 // to avoid overhead of thread specific singleton access 00054 // when deciding to keep or throw away messages 00055 // 00056 // 9 mf 9/23/10 Support for situations where no thresholds are low 00057 // enough to react to LogDebug (or info, or warning) 00058 // 00059 // 10 mf, crj 11/2/10 (see MessageServer/src/MessageLogger.cc change 17) 00060 // Support for reducing the string operations done when 00061 // moving from one module to the next. 00062 // 00063 // 11 mf 11/29/10 Snapshot method to preare for invalidation of the 00064 // pointers used to hold module context. Supports 00065 // surviving throws that cause objects to go out of scope. 00066 // 00067 // 12 fwyzard 7/6/11 Add support for discarding LogError-level messages 00068 // on a per-module basis (needed at HLT) 00069 00070 // user include files 00071 00072 namespace edm { 00073 00074 namespace messagedrop { 00075 class StringProducer; 00076 class StringProducerWithPhase; 00077 class StringProducerPath; 00078 class StringProducerSinglet; 00079 } 00080 00081 struct MessageDrop { 00082 private: 00083 MessageDrop(); // change log 10: 00084 // moved to cc file 00085 public: 00086 ~MessageDrop(); // change log 10 00087 static MessageDrop * instance (); 00088 std::string moduleName; 00089 std::string moduleContext(); 00090 void setModuleWithPhase(std::string const & name, 00091 std::string const & label, 00092 const void * moduleID, 00093 const char* phase); 00094 void setPath(const char* type, std::string const & pathname); 00095 void setSinglet(const char * sing); 00096 void snapshot(); 00097 std::string runEvent; 00098 std::string jobreport_name; // change log 5 00099 std::string jobMode; // change log 6 00100 static bool debugEnabled; // change log 8 00101 static bool infoEnabled; // change log 8 00102 static bool warningEnabled; // change log 8 00103 static bool errorEnabled; // change log 8, 12 00104 static unsigned char messageLoggerScribeIsRunning; // change log 7 00105 static edm::Exception * ex_p; // change log 4 00106 static bool debugAlwaysSuppressed; // change log 9 00107 static bool infoAlwaysSuppressed; // change log 9 00108 static bool warningAlwaysSuppressed; // change log 9 00109 private: 00110 messagedrop::StringProducerWithPhase * spWithPhase; 00111 messagedrop::StringProducerPath * spPath; 00112 messagedrop::StringProducerSinglet * spSinglet; 00113 messagedrop::StringProducer const * moduleNameProducer; 00114 }; 00115 00116 static const unsigned char MLSCRIBE_RUNNING_INDICATOR = 29; // change log 7 00117 00118 } // end of namespace edm 00119 00120 00121 #endif // MessageLogger_MessageDrop_h