ATLAS Offline Software
Public Member Functions | Static Private Attributes | List of all members
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; }

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

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

33 { return msg() << lvl; }

◆ 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

The documentation for this class was generated from the following file:
Trig::Logger::msg
MsgStream & msg() const
Definition: Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/Logger.h:29
python.iconfTool.gui.pad.logger
logger
Definition: pad.py:14