ATLAS Offline Software
Loading...
Searching...
No Matches
Trig::Logger Class Reference

Logging adaptor to provide interfaces required for ATH_MSG macros. More...

#include <Logger.h>

Inheritance diagram for Trig::Logger:
Collaboration diagram for Trig::Logger:

Public Member Functions

 Logger ()=default
 Logger (asg::AsgTool *logger)
MsgStream & msg () const
MsgStream & msg (const MSG::Level lvl) const
bool msgLvl (const MSG::Level lvl) const

Static Private Attributes

static asg::AsgTool *s_logger ATLAS_THREAD_SAFE {nullptr}

Detailed Description

Logging adaptor to provide interfaces required for ATH_MSG macros.

TrigDecisionTool helper classes derive from this class to be able to use the usual ATH_MSG macros in their code. One has to ensure that one class in the hierarchy initializes the (static) Logger via the non-default constructor. All messaging then occurs via the actual messaging implementation of that class.

Note that while we are using asg::AsgTool as the logger type, in a full athena release, this is a direct descendent of AthAlgTool.

Definition at line 24 of file Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/Logger.h.

Constructor & Destructor Documentation

◆ Logger() [1/2]

Trig::Logger::Logger ( )
default

◆ Logger() [2/2]

Trig::Logger::Logger ( asg::AsgTool * logger)
inline

Definition at line 27 of file Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/Logger.h.

27{ s_logger = logger; }
static Root::TMsgLogger logger("iLumiCalc")

Member Function Documentation

◆ msg() [1/2]

MsgStream & Trig::Logger::msg ( ) const
inline

Definition at line 29 of file Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/Logger.h.

29 {
30 if (s_logger) return s_logger->msg();
31 else throw std::runtime_error("TrigDecisionTool Logger not initialized.");
32 }

◆ msg() [2/2]

MsgStream & Trig::Logger::msg ( const MSG::Level lvl) const
inline

◆ msgLvl()

bool Trig::Logger::msgLvl ( const MSG::Level lvl) const
inline

Definition at line 34 of file Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/Logger.h.

34{ return s_logger && s_logger->msgLvl(lvl); }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

asg::AsgTool* s_logger Trig::Logger::ATLAS_THREAD_SAFE {nullptr}
inlinestaticprivate

Definition at line 38 of file Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/Logger.h.

38{nullptr};

The documentation for this class was generated from the following file: