8#include "GaudiKernel/INamedInterface.h"
9#include "GaudiKernel/CommonMessaging.h"
10#include "GaudiKernel/IMessageSvc.h"
11#include "GaudiKernel/MsgStream.h"
12#include "GaudiKernel/CommonMessaging.h"
14#include "Acts/Utilities/Logger.hpp"
29 (*m_msg) << athLevel << input <<
endmsg;
38std::unique_ptr<Acts::Logging::OutputPrintPolicy>
40 return std::make_unique<ActsAthenaPrintPolicy>(
m_msg,
name);
46 return m_msg->level() <= athLevel;
55std::unique_ptr<Acts::Logging::OutputFilterPolicy>
58 auto msg = std::make_shared<MsgStream>(*
m_msg);
60 return std::make_unique<ActsAthenaFilterPolicy>(
msg);
63std::unique_ptr<const Acts::Logger>
64makeActsAthenaLogger(IMessageSvc *svc,
const std::string& name,
int level, std::optional<std::string> parent_name)
66 using namespace Acts::Logging;
68 std::string full_name = name;
70 full_name = *parent_name +
"." + full_name;
73 auto msg = std::make_shared<MsgStream>(svc, full_name);
75 auto filter = std::make_unique<ActsAthenaFilterPolicy>(
msg);
76 auto print = std::make_unique<ActsAthenaPrintPolicy>(
msg, full_name);
77 return std::make_unique<const Acts::Logger>(std::move(
print), std::move(filter));
80std::unique_ptr<const Acts::Logger>
82 auto msg = std::make_shared<MsgStream>(parent->msg());
83 auto filter = std::make_unique<ActsAthenaFilterPolicy>(
msg);
84 auto print = std::make_unique<ActsAthenaPrintPolicy>(
msg, name);
85 return std::make_unique<const Acts::Logger>(std::move(
print), std::move(filter));
87std::unique_ptr<const Acts::Logger>
91 const INamedInterface *inamed =
dynamic_cast<const INamedInterface*
>(parent);
92 std::optional<std::string> parent_name = std::nullopt;
94 if (inamed ==
nullptr) {
95 throw std::invalid_argument(
"parent needs to be INamedInterface");
97 parent_name = inamed->name();
101std::unique_ptr<const Acts::Logger>
102makeActsAthenaLogger(
const CommonMessagingBase* parent,
const std::string& name, std::optional<std::string> parent_name)
105 const INamedInterface *inamed =
dynamic_cast<const INamedInterface*
>(parent);
106 if (inamed !=
nullptr) {
107 level = parent->msg().level();
112std::unique_ptr<const Acts::Logger>
113makeActsAthenaLogger(
const CommonMessagingBase* parent,
const std::string& name,
const std::string& parent_name)
void print(char *figname, TCanvas *c1)
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
std::shared_ptr< MsgStream > m_msg
virtual Acts::Logging::Level level() const override
virtual std::unique_ptr< Acts::Logging::OutputFilterPolicy > clone(Acts::Logging::Level level) const override
bool doPrint(const Acts::Logging::Level &lvl) const override
virtual const std::string & name() const override
virtual std::unique_ptr< Acts::Logging::OutputPrintPolicy > clone(const std::string &name) const override
void flush(const Acts::Logging::Level &lvl, const std::string &input) override
ActsAthenaPrintPolicy(std::shared_ptr< MsgStream > msg, const std::string &name)
std::shared_ptr< MsgStream > m_msg
Class to provide easy MsgStream access and capabilities.
singleton-like access to IMessageSvc via open function and helper
MSG::Level athLevelVector(Acts::Logging::Level lvl)
Acts::Logging::Level actsLevelVector(MSG::Level lvl)
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....