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__) \
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(); \
69#if defined(__FastCaloSimStandAlone__)
73typedef 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;
123 MSG::Level
level()
const {
return m_level; }
128 static std::string
startMsg(MSG::Level lvl,
const std::string&
file,
int line);
131 MsgStream &
msg()
const {
return *m_msg; }
133 MsgStream &
msg(
const MSG::Level lvl)
const;
135 MsgStream &stream(MSG::Level lvl, std::string
file,
int line)
const;
137 bool msgLvl(
const MSG::Level lvl)
const;
140 void print(MSG::Level lvl, std::string
file,
int line,
141 std::string message)
const;
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;
152 bool streamerNeedStart(MSG::Level lvl, std::string
file)
const;
154 MSG::Level m_level = MSG::INFO;
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;
161 mutable MSG::Level m_streamer_has_lvl = MSG::NIL;
162 mutable std::string m_streamer_from_file =
"";
171#define END_MSG(lvl) endmsg
180 MLogging(
const std::string &name =
"ISF_FastCaloSimEvent");
197 MsgStream &
msg(
const MSG::Level lvl)
const;
203 virtual void setLevel(MSG::Level lvl);
207 static std::string
startMsg(MSG::Level lvl,
const std::string&
file,
int line);
214 inline static boost::thread_specific_ptr<MsgStream> m_msg_tls
232 MsgStream *ms = m_msg_tls.get();
void print(char *figname, TCanvas *c1)
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.
MLogging(const std::string &name="ISF_FastCaloSimEvent")
Constructor.
virtual ~MLogging()
Destructor:
MsgStream & msg(const MSG::Level lvl) const
Return a decorated starting stream for sending messages.
virtual void setLevel(MSG::Level lvl)
Update outputlevel.
MLogging & operator=(const MLogging &rhs)
static std::string startMsg(MSG::Level lvl, const std::string &file, int line)
Make a message to decorate the start of logging.
static boost::thread_specific_ptr< MsgStream > m_msg_tls ATLAS_THREAD_SAFE
Do not persistify!
std::string m_nm
Message source name.
MsgStream & msg() const
Return a stream for sending messages directly (no decoration)
MSG::Level level() const
Retrieve output level.
singleton-like access to IMessageSvc via open function and helper
IMessageSvc * getMessageSvc(bool quiet=false)