ATLAS Offline Software
Loading...
Searching...
No Matches
Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/Logger.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TrigDecisionTool_Logger_h
6#define TrigDecisionTool_Logger_h
7
8#include "AsgTools/AsgTool.h"
10#include <stdexcept>
11
12namespace Trig{
24 class Logger {
25 public:
26 Logger() = default;
27 Logger(asg::AsgTool* logger) { s_logger = logger; }
28
29 MsgStream& msg() const {
30 if (s_logger) return s_logger->msg();
31 else throw std::runtime_error("TrigDecisionTool Logger not initialized.");
32 }
33 MsgStream& msg(const MSG::Level lvl) const { return msg() << lvl; }
34 bool msgLvl(const MSG::Level lvl) const { return s_logger && s_logger->msgLvl(lvl); }
35
36 private:
37 // we rely on the AsgTool logging being thread-safe
38 inline static asg::AsgTool* s_logger ATLAS_THREAD_SAFE {nullptr};
39 };
40}
41
42#endif
Define macros for attributes used to control the static checker.
Logger()=default
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
static Root::TMsgLogger logger("iLumiCalc")
The common trigger namespace for trigger analysis tools.