|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef ISF_FASTCALOSIMEVENT_MLogging_h
6 #define ISF_FASTCALOSIMEVENT_MLogging_h
11 #if defined(__FastCaloSimStandAlone__)
30 #define ATH_MSG_NOCLASS(logger_name, x) \
32 logger_name.msg() << logger_name.startMsg(MSG::ALWAYS, __FILE__, __LINE__) \
35 #else // not __FastCaloSimStandAlone__ We get some things from AthenaKernal.
42 #include "GaudiKernel/MsgStream.h"
43 #include "Gaudi/Property.h"
47 #include <boost/thread/tss.hpp>
52 #define ATH_MSG_NOCLASS(logger_name, x) \
54 logger_name.msg(MSG::ALWAYS) << x << std::endl; \
55 logger_name.msg().doOutput(); \
57 #endif // end not __FastCaloSimStandAlone__
69 #if defined(__FastCaloSimStandAlone__)
73 typedef std::ostream MsgStream;
75 #define ATH_MSG_LVL(enum_lvl, x) \
77 if (this->msgLvl(enum_lvl)) \
78 this->msg() << this->startMsg(enum_lvl, __FILE__, __LINE__) << x \
82 #define ATH_MSG_LVL_NOCHK(enum_lvl, x) \
84 this->msg() << this->startMsg(enum_lvl, __FILE__, __LINE__) << x \
88 #define ATH_MSG_VERBOSE(x) ATH_MSG_LVL(MSG::VERBOSE, x)
89 #define ATH_MSG_DEBUG(x) ATH_MSG_LVL(MSG::DEBUG, x)
90 #define ATH_MSG_INFO(x) ATH_MSG_LVL_NOCHK(MSG::INFO, x)
91 #define ATH_MSG_WARNING(x) ATH_MSG_LVL_NOCHK(MSG::WARNING, x)
92 #define ATH_MSG_ERROR(x) ATH_MSG_LVL_NOCHK(MSG::ERROR, x)
93 #define ATH_MSG_FATAL(x) ATH_MSG_LVL_NOCHK(MSG::FATAL, x)
100 #define ATH_MSG(lvl) this->stream(MSG::lvl, __FILE__, __LINE__)
102 #define END_MSG(lvl) this->streamerEndLine(MSG::lvl)
104 #define endmsg this->streamerEndLine(MSG::INFO)
115 m_level =
other.m_level;
131 MsgStream &
msg()
const {
return *m_msg; }
144 std::string streamerEndLine(
MSG::Level lvl)
const;
148 bool streamerInLine()
const {
return m_streamer_in_line; }
150 void streamerInLine(
bool is_in_line)
const;
156 MsgStream *m_msg = &std::cout;
157 MsgStream m_null_msg = MsgStream(
nullptr);
158 MsgStream *m_null_msg_ptr = &m_null_msg;
160 mutable bool m_streamer_in_line =
false;
162 mutable std::string m_streamer_from_file =
"";
168 #else // end __FastCaloSimStandAlone__
171 #define END_MSG(lvl) endmsg
180 MLogging(
const std::string &
name =
"ISF_FastCaloSimEvent");
194 MsgStream &
msg()
const;
214 inline static boost::thread_specific_ptr<MsgStream> m_msg_tls
232 MsgStream *
ms = m_msg_tls.get();
244 #endif // end not __FastCaloSimStandAlone__
248 #endif // End header guard
singleton-like access to IMessageSvc via open function and helper
MSG::Level level() const
Retrieve output level.
MLogging & operator=(const MLogging &rhs)
virtual ~MLogging()
Destructor:
IMessageSvc * getMessageSvc(bool quiet=false)
static boost::thread_specific_ptr< MsgStream > m_msg_tls ATLAS_THREAD_SAFE
Do not persistify!
MLogging(const std::string &name="ISF_FastCaloSimEvent")
Constructor.
MsgStream & msg() const
Return a stream for sending messages directly (no decoration)
std::string m_nm
Message source name.
void print(char *figname, TCanvas *c1)
virtual void setLevel(MSG::Level lvl)
Update outputlevel.
static std::string startMsg(MSG::Level lvl, const std::string &file, int line)
Make a message to decorate the start of logging.
Define macros for attributes used to control the static checker.
bool msgLvl(const MSG::Level lvl) const
Check whether the logging system is active at the provided verbosity level.