ATLAS Offline Software
AthMsgStreamMacros.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // AthMsgStreamMacros.h
8 // Header file for useful macros when comes to using MsgStream
9 // Author: S.Binet<binet@cern.ch>
11 #ifndef ATHENABASECOMPS_ATHMSGSTREAMMACROS_H
12 #define ATHENABASECOMPS_ATHMSGSTREAMMACROS_H 1
13 
14 // CxxUtils
16 
17 // FIXME: operator precedence ?!
18 #define ATH_MSG_LVL_NOCHK(lvl, x) \
19  this->msg(lvl) << x << endmsg
20 
21 #define ATH_MSG_LVL(lvl, x) \
22  do { \
23  if (ATH_UNLIKELY(this->msgLvl (lvl))) { \
24  ATH_MSG_LVL_NOCHK(lvl, x); \
25  } \
26  } while (0)
27 
28 #define ATH_MSG_VERBOSE(x) ATH_MSG_LVL(MSG::VERBOSE, x)
29 #define ATH_MSG_DEBUG(x) ATH_MSG_LVL(MSG::DEBUG, x)
30 // note that we are using the _NOCHK variant here
31 #define ATH_MSG_INFO(x) ATH_MSG_LVL_NOCHK(MSG::INFO, x)
32 #define ATH_MSG_WARNING(x) ATH_MSG_LVL_NOCHK(MSG::WARNING, x)
33 #define ATH_MSG_ERROR(x) ATH_MSG_LVL_NOCHK(MSG::ERROR, x)
34 #define ATH_MSG_FATAL(x) ATH_MSG_LVL_NOCHK(MSG::FATAL, x)
35 #define ATH_MSG_ALWAYS(x) ATH_MSG_LVL_NOCHK(MSG::ALWAYS, x)
36 
37 // can be used like so: ATH_MSG(INFO) << "hello" << endmsg;
38 #define ATH_MSG(lvl) \
39  if (this->msgLvl(MSG::lvl)) this->msg(MSG::lvl)
40 
41 #endif //> !ATHENABASECOMPS_ATHMSGSTREAMMACROS_H
42 
AthUnlikelyMacros.h