ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigConfiguration
TrigConfBase
Root
Trigger/TrigConfiguration/TrigConfBase/Root/MsgStream.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include <iostream>
6
#include <iomanip>
7
#include "
TrigConfBase/MsgStream.h
"
8
9
using namespace
TrigConf
;
10
15
class
IMessageSvc;
16
21
namespace
Athena
{
22
IMessageSvc*
getMessageSvc
(
bool
)
__attribute__
((weak));
23
void
reportMessage
(IMessageSvc*,
const
std::string&,
int
,
const
std::string&)
__attribute__
((weak));
24
int
outputLevel
(
const
IMessageSvc*,
const
std::string&)
__attribute__
((weak));
25
void
setOutputLevel
(IMessageSvc*,
const
std::string&,
int
)
__attribute__
((weak));
26
}
27
28
29
namespace
{
30
32
static
IMessageSvc*
getMessageSvc
() {
33
//coverity[BAD_COMPARE]
34
return
Athena::getMessageSvc
?
Athena::getMessageSvc
(
/*quiet=*/
true
) : nullptr;
35
}
36
37
static
const
char
*
const
levelNames
[
MSGTC::NUM_LEVELS
] =
38
{
"NIL"
,
"VERBOSE"
,
"DEBUG"
,
"INFO"
,
"WARNING"
,
"ERROR"
,
"FATAL"
,
"ALWAYS"
};
39
}
40
41
MsgStreamTC::MsgStreamTC
(
const
std::string&
name
) :
42
m_active
(false),
43
m_msgLevel
(
MSGTC
::INFO),
44
m_name
(
name
)
45
{
46
// Initialize our own OutputLevel to the global one from the MessageSvc
47
//coverity[BAD_COMPARE]
48
m_level
=
Athena::outputLevel
?
MSGTC::Level
(
Athena::outputLevel
(getMessageSvc(),
m_name
)) :
MSGTC::INFO
;
49
}
50
51
// Set message level of stream
52
void
MsgStreamTC::setLevel
(
MSGTC::Level
lvl) {
53
lvl = (lvl >=
MSGTC::NUM_LEVELS
) ?
MSGTC::ALWAYS
: (lvl<
MSGTC::NIL
) ?
MSGTC::NIL
: lvl;
54
m_level
= lvl;
55
if
(getMessageSvc()) {
56
Athena::setOutputLevel
(getMessageSvc(),
m_name
,
m_level
);
57
}
58
}
59
60
void
MsgStreamTC::doOutput
()
61
{
62
if
(getMessageSvc()) {
63
Athena::reportMessage
(getMessageSvc(),
m_name
,
m_msgLevel
,
str
());
64
}
65
else
{
66
std::ios::fmtflags f( std::cout.flags() );
67
std::cout << std::setw(
m_width
) << std::left <<
m_name
<<
" "
<<
levelNames
[
m_msgLevel
] <<
" "
<<
str
() << std::endl;
68
std::cout.flags(f);
69
}
70
str
(
""
);
// Clear our buffer after message has been printed
71
}
levelNames
static constexpr std::string levelNames[MSG::NUM_LEVELS]
Definition
AthenaSummarySvc.cxx:29
__attribute__
__attribute__((always_inline)) inline uint16_t TileCalibDrawerBase
Definition
TileCalibDrawerBase.h:192
MsgStream.h
MsgStream for TrigConf classes.
TrigConf::MsgStreamTC::m_level
MSGTC::Level m_level
stream level
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:106
TrigConf::MsgStreamTC::m_name
std::string m_name
stream name
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:108
TrigConf::MsgStreamTC::m_msgLevel
MSGTC::Level m_msgLevel
current message level
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:107
TrigConf::MsgStreamTC::setLevel
void setLevel(MSGTC::Level lvl)
Set message level of stream.
Definition
Trigger/TrigConfiguration/TrigConfBase/Root/MsgStream.cxx:52
TrigConf::MsgStreamTC::m_width
unsigned int m_width
width for printing owner name
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:109
TrigConf::MsgStreamTC::MsgStreamTC
MsgStreamTC(const std::string &name)
Definition
Trigger/TrigConfiguration/TrigConfBase/Root/MsgStream.cxx:41
TrigConf::MsgStreamTC::doOutput
void doOutput()
Print the current message buffer.
Definition
Trigger/TrigConfiguration/TrigConfBase/Root/MsgStream.cxx:60
TrigConf::MsgStreamTC::m_active
bool m_active
stream active?
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:105
Athena
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
Definition
AthDsoUtils.h:10
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition
getMessageSvc.cxx:20
Athena::outputLevel
int outputLevel(const IMessageSvc *ims, const std::string &source)
Definition
getMessageSvc.cxx:60
Athena::reportMessage
void reportMessage(IMessageSvc *ims, const std::string &source, int type, const std::string &message)
Wrappers for some of the IMessageSvc methods These can be used from libraries without explicit Gaudi ...
Definition
getMessageSvc.cxx:56
Athena::setOutputLevel
void setOutputLevel(IMessageSvc *ims, const std::string &source, int level)
Definition
getMessageSvc.cxx:65
TrigConf::MSGTC
Messsage levels matching the Gaudi definition.
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:20
TrigConf::MSGTC::Level
Level
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
TrigConf::MSGTC::NUM_LEVELS
@ NUM_LEVELS
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:30
TrigConf::MSGTC::NIL
@ NIL
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:22
TrigConf::MSGTC::INFO
@ INFO
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:25
TrigConf::MSGTC::ALWAYS
@ ALWAYS
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:29
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition
IDPerfMonZmumu.h:57
str
Definition
BTagTrackIpAccessor.cxx:11
TrigConf::name
Definition
HLTChainList.h:35
Generated on
for ATLAS Offline Software by
1.17.0