All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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"
7 #include "GaudiKernel/Property.h"
8 #include "StreamLogger.h"
9 #include "boost/function.hpp"
10 #include <string>
11 #include <vector>
12 #include <map>
13 
14 
15 class IssueLogger: public extends1<Service, IIssueLogger> {
16 public:
17 
18  virtual StatusCode initialize();
19  virtual StatusCode reinitialize();
20  virtual StatusCode finalize();
21 
22  IssueLogger(const std::string& name, ISvcLocator *svc );
23 
24  void report(IssueSeverity::Level level, const std::string& msg,
25  const std::string& origin);
26  void report(const IssueSeverity& err);
27 
28 
29 protected:
30 
31  virtual ~IssueLogger();
32 
33 private:
34 
38 
40 
42  boost::function<void (const std::string&)> m_log[IssueSeverity::NUM_LEVELS];
43 
44  std::map<MSG::Level, IssueSeverity::Level> m_msgSevMap;
45  std::map<IssueSeverity::Level, MSG::Level> m_sevMsgMap;
46  std::map<IssueSeverity::Level, std::string> m_levelTrans;
47  std::map<std::string, IssueSeverity::Level> m_levelSTrans;
48 
49 
50  StatusCode connect( const std::string& );
51  void getTraceBack(std::string& stack);
52 
55 
56  void setupDefaultLogger();
57  void setupLevels(Property& prop);
58  void setupStreams(Property& prop);
59 
60 };
61 
62 #endif
MSG::Level sevToMsg(IssueSeverity::Level &lev)
std::map< IssueSeverity::Level, std::string > m_levelTrans
Definition: IssueLogger.h:46
StatusCode connect(const std::string &)
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:26
void report(IssueSeverity::Level level, const std::string &msg, const std::string &origin)
std::map< std::string, IssueSeverity::Level > m_levelSTrans
Definition: IssueLogger.h:47
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
StringArrayProperty m_outputfile
Definition: IssueLogger.h:35
IssueSeverity::Level m_reportLevel
Definition: IssueLogger.h:39
StringProperty m_reportLevelS
Definition: IssueLogger.h:36
MsgStream & err() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
void setupDefaultLogger()
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
StreamLogger * m_logger[IssueSeverity::NUM_LEVELS]
Definition: IssueLogger.h:41
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:43
void getTraceBack(std::string &stack)
void setupStreams(Property &prop)
void setupLevels(Property &prop)
virtual StatusCode reinitialize()
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
boost::function< void(const std::string &)> m_log[IssueSeverity::NUM_LEVELS]
Definition: IssueLogger.h:42
IssueSeverity::Level m_traceLevel
Definition: IssueLogger.h:39
std::map< IssueSeverity::Level, MSG::Level > m_sevMsgMap
Definition: IssueLogger.h:45
BooleanProperty m_showTime
Definition: IssueLogger.h:37
std::map< MSG::Level, IssueSeverity::Level > m_msgSevMap
Definition: IssueLogger.h:44
virtual ~IssueLogger()
Definition: IssueLogger.cpp:98
StringProperty m_traceLevelS
Definition: IssueLogger.h:36
IssueSeverity::Level msgToSev(MSG::Level &lev)
IssueLogger(const std::string &name, ISvcLocator *svc)
Definition: IssueLogger.cpp:28