ATLAS Offline Software
Loading...
Searching...
No Matches
AthMsgStreamMacros.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2026 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
15
16// FIXME: operator precedence ?!
17#define ATH_MSG_LVL_NOCHK(lvl, x) \
18 this->msg(lvl) << x << endmsg
19
20#define ATH_MSG_LVL(lvl, x) \
21 do { \
22 if (this->msgLvl (lvl)) [[unlikely]] { \
23 ATH_MSG_LVL_NOCHK(lvl, x); \
24 } \
25 } while (0)
26
27#define ATH_MSG_VERBOSE(x) ATH_MSG_LVL(MSG::VERBOSE, x)
28#define ATH_MSG_DEBUG(x) ATH_MSG_LVL(MSG::DEBUG, x)
29// note that we are using the _NOCHK variant here
30#define ATH_MSG_INFO(x) ATH_MSG_LVL_NOCHK(MSG::INFO, x)
31#define ATH_MSG_WARNING(x) ATH_MSG_LVL_NOCHK(MSG::WARNING, x)
32#define ATH_MSG_ERROR(x) ATH_MSG_LVL_NOCHK(MSG::ERROR, x)
33#define ATH_MSG_FATAL(x) ATH_MSG_LVL_NOCHK(MSG::FATAL, x)
34#define ATH_MSG_ALWAYS(x) ATH_MSG_LVL_NOCHK(MSG::ALWAYS, x)
35
36// can be used like so: ATH_MSG(INFO) << "hello" << endmsg;
37#define ATH_MSG(lvl) \
38 if (this->msgLvl(MSG::lvl)) this->msg(MSG::lvl)
39
40#endif //> !ATHENABASECOMPS_ATHMSGSTREAMMACROS_H
41