| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

IssueLogger.h
Go to the documentation of this file.
1 #ifndef GAUDISVC_ISSUELOGGER_H
2 #define GAUDISVC_ISSUELOGGER_H
3
4 #include "GaudiKernel/Service.h"
5 #include "GaudiKernel/IIssueLogger.h"
6 #include "GaudiKernel/IssueSeverity.h"
7 #include "GaudiKernel/Property.h"
8 #include "StreamLogger.h"
9 #include <string>
10 #include <vector>
11 #include <map>
12
13
14 class IssueLogger: public extends<Service,
15 IIssueLogger> {
16 public:
17 IssueLogger(const std::string& name, ISvcLocator *svc );
18 ~IssueLogger() override = default;
19
20 StatusCode initialize() override;
21 StatusCode reinitialize() override;
22 StatusCode finalize() override;
23
24 void report(IssueSeverity::Level level, const std::string& msg,
25 const std::string& origin) override;
26 void report(const IssueSeverity& err) override;
27
28 private:
29
30 StringArrayProperty m_outputfile;
31 StringProperty m_reportLevelS, m_traceLevelS;
32 BooleanProperty m_showTime;
33 IssueSeverity::Level m_reportLevel, m_traceLevel;
34
35 class logger_t final {
36 std::unique_ptr<StreamLogger> m_logger ;
37 void (StreamLogger::*m_fun)(const std::string&) = nullptr;
38 public:
39 logger_t() = default;
40 logger_t( StreamLogger* logger, void (StreamLogger::*fun)(const std::string&) )
41 : m_logger{ logger }, m_fun{ fun } {}
42 void operator()(const std::string& s) const { (m_logger.get()->*m_fun)(s); }
43 const std::string& name() const { return m_logger->name(); }
44 explicit operator bool () const { return bool(m_logger); }
45 void reset() { m_logger.reset(); }
46 };
47 std::array<logger_t,IssueSeverity::NUM_LEVELS> m_log;
48
49 StatusCode connect( const std::string& );
50 void setupDefaultLogger();
51 void setupLevels(Property& prop);
52 void setupStreams(Property& prop);
53
54 };
55
56 #endif
StreamLogger
Definition: StreamLogger.h:11
CommonMessagingBase::msg
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:133
IssueLogger::connect
StatusCode connect(const std::string &)
Definition: IssueLogger.cpp:124
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
IssueSeverity
Definition: IssueSeverity.h:42
IssueLogger::logger_t::logger_t
logger_t()=default
IssueLogger::finalize
StatusCode finalize() override
Definition: IssueLogger.cpp:112
IssueLogger::~IssueLogger
~IssueLogger() override=default
IssueLogger::m_outputfile
StringArrayProperty m_outputfile
Definition: IssueLogger.h:30
IssueLogger::m_reportLevel
IssueSeverity::Level m_reportLevel
Definition: IssueLogger.h:33
IssueLogger::logger_t::m_logger
std::unique_ptr< StreamLogger > m_logger
Definition: IssueLogger.h:36
IssueLogger::m_reportLevelS
StringProperty m_reportLevelS
Definition: IssueLogger.h:31
CommonMessagingBase::err
MsgStream & err() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:115
IssueLogger::logger_t::operator()
void operator()(const std::string &s) const
Definition: IssueLogger.h:42
StreamLogger::name
const std::string & name() const
Definition: StreamLogger.h:17
Gaudi::PluginService::Details::logger
GAUDIPS_API Logger & logger()
Return the current logger instance.
Definition: PluginService.cpp:337
std::string
STL class.
SimpleProperty< std::vector< std::string > >
Service.h
IssueLogger::setupDefaultLogger
void setupDefaultLogger()
Definition: IssueLogger.cpp:245
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
IssueLogger::logger_t
Definition: IssueLogger.h:35
IssueSeverity::Level
Level
Definition: IssueSeverity.h:46
IIssueLogger.h
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IssueSeverity.h
std::unique_ptr::reset
T reset(T...args)
IssueLogger::reinitialize
StatusCode reinitialize() override
Definition: IssueLogger.cpp:102
IssueLogger::logger_t::reset
void reset()
Definition: IssueLogger.h:45
IssueLogger::m_log
std::array< logger_t, IssueSeverity::NUM_LEVELS > m_log
Definition: IssueLogger.h:47
std::unique_ptr::get
T get(T...args)
IssueLogger::logger_t::name
const std::string & name() const
Definition: IssueLogger.h:43
IssueLogger
Definition: IssueLogger.h:14
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
StreamLogger.h
std::unique_ptr< StreamLogger >
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
IssueLogger::setupStreams
void setupStreams(Property &prop)
Definition: IssueLogger.cpp:227
IssueLogger::setupLevels
void setupLevels(Property &prop)
Definition: IssueLogger.cpp:194
IssueLogger::initialize
StatusCode initialize() override
Definition: IssueLogger.cpp:92
Property.h
fun
double fun(const std::vector< double > &x)
Definition: PFuncTest.cpp:26
IssueLogger::logger_t::logger_t
logger_t(StreamLogger *logger, void(StreamLogger::*fun)(const std::string &))
Definition: IssueLogger.h:40
gaudirun.s
string s
Definition: gaudirun.py:245
std::array
STL class.
gaudirun.level
level
Definition: gaudirun.py:261
IssueLogger::logger_t::m_fun
void(StreamLogger::* m_fun)(const std::string &)
Definition: IssueLogger.h:37
IssueLogger::m_traceLevel
IssueSeverity::Level m_traceLevel
Definition: IssueLogger.h:33
IssueLogger::m_showTime
BooleanProperty m_showTime
Definition: IssueLogger.h:32
IssueLogger::m_traceLevelS
StringProperty m_traceLevelS
Definition: IssueLogger.h:31
IssueLogger::report
void report(IssueSeverity::Level level, const std::string &msg, const std::string &origin) override
Definition: IssueLogger.cpp:175
IssueLogger::IssueLogger
IssueLogger(const std::string &name, ISvcLocator *svc)
Definition: IssueLogger.cpp:72