All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
IssueLogger Class Reference

#include <src/IssueLogger.h>

Inheritance diagram for IssueLogger:
Collaboration diagram for IssueLogger:

Public Member Functions

virtual StatusCode initialize ()
 Initialization (from CONFIGURED to INITIALIZED). More...
 
virtual StatusCode reinitialize ()
 Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED). More...
 
virtual StatusCode finalize ()
 Finalize (from INITIALIZED to CONFIGURED). More...
 
 IssueLogger (const std::string &name, ISvcLocator *svc)
 
void report (IssueSeverity::Level level, const std::string &msg, const std::string &origin)
 
void report (const IssueSeverity &err)
 
- Public Member Functions inherited from extends1< Service, IIssueLogger >
 extends1 (A1 a1, A2 a2, A3 a3)
 Templated constructor with 3 arguments. More...
 
 extends1 (A1 a1, A2 a2)
 Templated constructor with 2 arguments. More...
 
 extends1 (A1 a1)
 Templated constructor with 1 argument. More...
 
 extends1 ()
 Default constructor. More...
 
virtual void * i_cast (const InterfaceID &tid) const
 Implementation of IInterface::i_cast. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)
 Implementation of IInterface::queryInterface. More...
 
virtual std::vector< std::string > getInterfaceNames () const
 Implementation of IInterface::getInterfaceNames. More...
 
virtual ~extends1 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from Service
virtual unsigned long release ()
 Release Interface instance. More...
 
virtual const std::string & name () const
 Retrieve name of the service. More...
 
virtual StatusCode configure ()
 Configuration (from OFFLINE to CONFIGURED). More...
 
virtual StatusCode start ()
 Start (from INITIALIZED to RUNNING). More...
 
virtual StatusCode stop ()
 Stop (from RUNNING to INITIALIZED). More...
 
virtual StatusCode terminate ()
 Initialization (from CONFIGURED to OFFLINE). More...
 
virtual Gaudi::StateMachine::State FSMState () const
 Get the current state. More...
 
virtual Gaudi::StateMachine::State targetFSMState () const
 When we are in the middle of a transition, get the state where the transition is leading us. More...
 
virtual StatusCode restart ()
 Initialization (from RUNNING to RUNNING, via INITIALIZED). More...
 
virtual StatusCode sysInitialize ()
 Initialize Service. More...
 
virtual StatusCode sysStart ()
 Initialize Service. More...
 
virtual StatusCode sysStop ()
 Initialize Service. More...
 
virtual StatusCode sysFinalize ()
 Finalize Service. More...
 
virtual StatusCode sysReinitialize ()
 Re-initialize the Service. More...
 
virtual StatusCode sysRestart ()
 Re-initialize the Service. More...
 
virtual StatusCode setProperty (const Property &p)
 Set the property by property. More...
 
virtual StatusCode setProperty (const std::string &s)
 Set the property by string. More...
 
virtual StatusCode setProperty (const std::string &n, const std::string &v)
 Set the property by std::string. More...
 
virtual StatusCode getProperty (Property *p) const
 Get the property by property. More...
 
virtual const PropertygetProperty (const std::string &name) const
 Get the property by name. More...
 
virtual StatusCode getProperty (const std::string &n, std::string &v) const
 Get the property by std::string. More...
 
virtual const std::vector
< Property * > & 
getProperties () const
 Get list of properties. More...
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
 Service (const std::string &name, ISvcLocator *svcloc)
 Standard Constructor. More...
 
SmartIF< ISvcLocator > & serviceLocator () const
 Retrieve pointer to service locator. More...
 
StatusCode setProperties ()
 Method for setting declared properties to the values specified for the job. More...
 
template<class T >
StatusCode service (const std::string &name, const T *&psvc, bool createIf=true) const
 Access a service by name, creating it if it doesn't already exist. More...
 
template<class T >
StatusCode service (const std::string &name, T *&psvc, bool createIf=true) const
 
template<class T >
StatusCode service (const std::string &svcType, const std::string &svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist. More...
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties. More...
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
- Public Member Functions inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
 CommonMessaging (const A1 &a1, const A2 &a2, const A3 &a3)
 Templated constructor with 3 arguments. More...
 
 CommonMessaging (const A1 &a1, const A2 &a2)
 Templated constructor with 2 arguments. More...
 
 CommonMessaging (const A1 &a1)
 Templated constructor with 1 argument. More...
 
 CommonMessaging ()
 Default constructor. More...
 
virtual ~CommonMessaging ()
 Virtual destructor. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 
- Public Member Functions inherited from extend_interfaces3< IService, IProperty, IStateful >
virtual ~extend_interfaces3 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IService
 DeclareInterfaceID (IService, 3, 0)
 InterfaceID. More...
 
virtual ~IService ()
 virtual destructor More...
 
- Public Member Functions inherited from INamedInterface
 DeclareInterfaceID (INamedInterface, 1, 0)
 InterfaceID. More...
 
virtual ~INamedInterface ()
 Virtual destructor (always needed for abstract classes). More...
 
- Public Member Functions inherited from IInterface
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual ~IInterface ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IProperty
 DeclareInterfaceID (IProperty, 2, 0)
 InterfaceID. More...
 
- Public Member Functions inherited from IStateful
 DeclareInterfaceID (IStateful, 1, 0)
 InterfaceID. More...
 
virtual ~IStateful ()
 
- Public Member Functions inherited from extend_interfaces1< IIssueLogger >
virtual ~extend_interfaces1 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IIssueLogger
 DeclareInterfaceID (IIssueLogger, 2, 0)
 InterfaceID. More...
 

Protected Member Functions

virtual ~IssueLogger ()
 
- Protected Member Functions inherited from Service
virtual ~Service ()
 Standard Destructor. More...
 
int outputLevel () const
 get the Service's output level More...
 
- Protected Member Functions inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 

Private Member Functions

StatusCode connect (const std::string &)
 
void getTraceBack (std::string &stack)
 
MSG::Level sevToMsg (IssueSeverity::Level &lev)
 
IssueSeverity::Level msgToSev (MSG::Level &lev)
 
void setupDefaultLogger ()
 
void setupLevels (Property &prop)
 
void setupStreams (Property &prop)
 

Private Attributes

StringArrayProperty m_outputfile
 
StringProperty m_reportLevelS
 
StringProperty m_traceLevelS
 
BooleanProperty m_showTime
 
IssueSeverity::Level m_reportLevel
 
IssueSeverity::Level m_traceLevel
 
StreamLoggerm_logger [IssueSeverity::NUM_LEVELS]
 
boost::function< void(const
std::string &)> 
m_log [IssueSeverity::NUM_LEVELS]
 
std::map< MSG::Level,
IssueSeverity::Level
m_msgSevMap
 
std::map< IssueSeverity::Level,
MSG::Level
m_sevMsgMap
 
std::map< IssueSeverity::Level,
std::string > 
m_levelTrans
 
std::map< std::string,
IssueSeverity::Level
m_levelSTrans
 

Additional Inherited Members

- Public Types inherited from extends1< Service, IIssueLogger >
typedef extends1 base_class
 Typedef to this class. More...
 
typedef extend_interfaces1
< IIssueLogger
extend_interfaces_base
 Typedef to the base of this class. More...
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from Service
typedef
Gaudi::PluginService::Factory
< IService *, const
std::string &, ISvcLocator * > 
Factory
 
- Public Types inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
typedef CommonMessaging base_class
 
- Public Types inherited from implements3< IService, IProperty, IStateful >
typedef implements3 base_class
 Typedef to this class. More...
 
typedef extend_interfaces3
< IService, IProperty,
IStateful
extend_interfaces_base
 Typedef to the base of this class. More...
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from extend_interfaces3< IService, IProperty, IStateful >
typedef mpl::fold< typename
IService::iid::iids::type,
typename mpl::fold< typename
IProperty::iid::iids::type,
typename
IStateful::iid::iids::type,
mpl::insert< mpl::_1, mpl::_2 >
>::type, mpl::insert< mpl::_1,
mpl::_2 > >::type 
ext_iids
 MPL set of interfaces extended by this one. More...
 
- Public Types inherited from IInterface
enum  Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR }
 Return status. More...
 
typedef Gaudi::InterfaceId
< IInterface, 0, 0 > 
iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 
- Public Types inherited from extend_interfaces1< IIssueLogger >
typedef
IIssueLogger::iid::iids::type 
ext_iids
 MPL set of interfaces extended by this one. More...
 
- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 
- Protected Attributes inherited from Service
IntegerProperty m_outputLevel
 Service output level. More...
 
Gaudi::StateMachine::State m_state
 Service state. More...
 
Gaudi::StateMachine::State m_targetState
 Service state. More...
 
- Protected Attributes inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
SmartIF< IMessageSvcm_msgsvc
 Pointer to the message service;. More...
 
std::auto_ptr< MsgStreamm_msgStream
 The predefined message stream. More...
 
bool m_streamWithService
 Flag to create a new MsgStream if it was created without the message service. More...
 

Detailed Description

Definition at line 15 of file IssueLogger.h.

Constructor & Destructor Documentation

IssueLogger::IssueLogger ( const std::string &  name,
ISvcLocator svc 
)

Definition at line 28 of file IssueLogger.cpp.

29  : base_class(name, svc) {
30 
31  declareProperty ("Output", m_outputfile );
32  declareProperty ("ReportLevel", m_reportLevelS="WARNING");
33  declareProperty ("TracebackLevel", m_traceLevelS="ERROR");
34  declareProperty ("ShowTime", m_showTime=false);
35 
39 
42 
43  for (int i=0; i<IssueSeverity::NUM_LEVELS; ++i) {
44  m_logger[i] = 0;
45  }
46 
55 
68 
80 
92 
93 
94 }
std::map< IssueSeverity::Level, std::string > m_levelTrans
Definition: IssueLogger.h:46
std::map< std::string, IssueSeverity::Level > m_levelSTrans
Definition: IssueLogger.h:47
StringArrayProperty m_outputfile
Definition: IssueLogger.h:35
IssueSeverity::Level m_reportLevel
Definition: IssueLogger.h:39
extends1 base_class
Typedef to this class.
Definition: extends.h:12
StringProperty m_reportLevelS
Definition: IssueLogger.h:36
virtual void declareUpdateHandler(PropertyCallbackFunctor *pf)
set new callback for update
Definition: Property.cpp:141
StreamLogger * m_logger[IssueSeverity::NUM_LEVELS]
Definition: IssueLogger.h:41
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
void setupStreams(Property &prop)
void setupLevels(Property &prop)
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:211
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
list i
Definition: ana.py:128
std::map< MSG::Level, IssueSeverity::Level > m_msgSevMap
Definition: IssueLogger.h:44
StringProperty m_traceLevelS
Definition: IssueLogger.h:36
IssueLogger::~IssueLogger ( )
protectedvirtual

Definition at line 98 of file IssueLogger.cpp.

98  {
99 
100 }

Member Function Documentation

StatusCode IssueLogger::connect ( const std::string &  ident)
private

Definition at line 157 of file IssueLogger.cpp.

157  {
158 
159  MsgStream log ( msgSvc(), name() );
160  Tokenizer tok(true);
161 
162  string::size_type loc = ident.find(" ");
163 // string stream = ident.substr(0,loc); // icc remark #177: variable "stream" was declared but never referenced
164 // typedef std::pair<std::string,std::string> Prop;
165 // std::vector<Prop> props;
166  string val,VAL,TAG,filename;
167 
168  tok.analyse(ident.substr(loc+1,ident.length()), " ", "", "", "=", "'", "'");
169 
170  for ( Tokenizer::Items::iterator i = tok.items().begin();
171  i != tok.items().end(); i++) {
172  const std::string& tag = (*i).tag();
173  TAG = tag;
174  toupper(TAG);
175 
176  val = (*i).value();
177  VAL = val;
178  toupper(VAL);
179 
181 
182  if (TAG == "DEBUG") {
183  level = IssueSeverity::DEBUG;
184  } else if ( TAG == "INFO") {
185  level = IssueSeverity::INFO;
186  } else if ( TAG == "WARNING") {
187  level = IssueSeverity::WARNING;
188  } else if ( TAG == "RECOVERABLE") {
190  } else if ( TAG == "ERROR") {
191  level = IssueSeverity::ERROR;
192  } else if ( TAG == "FATAL") {
193  level = IssueSeverity::FATAL;
194  } else {
195  log << MSG::ERROR << "Unknown output level \"" << TAG << "\""
196  << endmsg;
197  continue;
198  }
199 
200  if (m_logger[level] != 0) {
201  log << MSG::INFO << "closing stream " << m_logger[level]->name()
202  << endmsg;
203  delete m_logger[level];
204  m_logger[level] = 0;
205  }
206 
207  if (val == "MsgSvc") {
208  m_logger[level] = new StreamLogger(msgSvc(), m_sevMsgMap[level]);
209  m_log[level] =
210  boost::bind(&StreamLogger::WriteToMsgSvc, m_logger[level],
211  _1);
212  } else if (val == "STDERR") {
213  m_logger[level] = new StreamLogger(std::cerr);
214  m_log[level] =
215  boost::bind(&StreamLogger::WriteToStream, m_logger[level],
216  _1);
217  } else if (val == "STDOUT") {
218  m_logger[level] = new StreamLogger(std::cout);
219  m_log[level] =
220  boost::bind(&StreamLogger::WriteToStream, m_logger[level],
221  _1);
222  } else { // A file
223  try {
224  m_logger[level] = new StreamLogger(val.c_str());
225  }
226  catch (std::exception&) {
227  m_logger[level] = 0;
228  log << MSG::ERROR << "Unable to open file \"" << VAL
229  << "\" for writing issues at level " << TAG << endmsg;
230  return StatusCode::FAILURE;
231  }
232  m_log[level] =
233  boost::bind(&StreamLogger::WriteToStream, m_logger[level], _1);
234  }
235  log << MSG::DEBUG << "Writing " << m_levelTrans[level]
236  << " issues to " << m_logger[level]->name() << endmsg;
237 
238  }
239 
240  return StatusCode::SUCCESS;
241 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
std::map< IssueSeverity::Level, std::string > m_levelTrans
Definition: IssueLogger.h:46
void toupper(std::string &s)
Definition: IssueLogger.cpp:20
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
StreamLogger * m_logger[IssueSeverity::NUM_LEVELS]
Definition: IssueLogger.h:41
STL Include files.
Definition: Tokenizer.h:24
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
void WriteToMsgSvc(const std::string &str)
Definition: StreamLogger.h:22
boost::function< void(const std::string &)> m_log[IssueSeverity::NUM_LEVELS]
Definition: IssueLogger.h:42
std::string name() const
std::map< IssueSeverity::Level, MSG::Level > m_sevMsgMap
Definition: IssueLogger.h:45
list i
Definition: ana.py:128
void WriteToStream(const std::string &str)
Definition: StreamLogger.h:21
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode IssueLogger::finalize ( )
virtual

Finalize (from INITIALIZED to CONFIGURED).

Reimplemented from Service.

Definition at line 132 of file IssueLogger.cpp.

132  {
133 
134  MsgStream log ( msgSvc(), name() );
135  log << MSG::DEBUG << "IssueLogger::finalize" << endmsg;
136 
137  for (int i=0; i<IssueSeverity::NUM_LEVELS; ++i) {
139  delete m_logger[j];
140  }
141 
142  return Service::finalize();
143 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
StreamLogger * m_logger[IssueSeverity::NUM_LEVELS]
Definition: IssueLogger.h:41
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
list i
Definition: ana.py:128
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
Definition: Service.cpp:199
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
void IssueLogger::getTraceBack ( std::string &  stack)
private

Definition at line 148 of file IssueLogger.cpp.

148  {
149  const int depth = 30;
150  const int offset = 5;
151  System::backTrace(stack, depth, offset);
152 }
GAUDI_API int backTrace(void **addresses, const int depth)
StatusCode IssueLogger::initialize ( )
virtual

Initialization (from CONFIGURED to INITIALIZED).

Reimplemented from Service.

Definition at line 105 of file IssueLogger.cpp.

105  {
106 
108  if (st.isFailure()) { return st; }
109 
111 
112  return st;
113 
114 }
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:72
void setupDefaultLogger()
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
Definition: Service.cpp:74
IssueSeverity::Level IssueLogger::msgToSev ( MSG::Level lev)
private
StatusCode IssueLogger::reinitialize ( )
virtual

Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).

Reimplemented from Service.

Definition at line 119 of file IssueLogger.cpp.

119  {
120 
121  MsgStream log ( msgSvc(), name() );
122  log << MSG::WARNING << "reinitialize not implemented" << endmsg;
123 
124 
125  return StatusCode::SUCCESS;
126 
127 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
void IssueLogger::report ( IssueSeverity::Level  level,
const std::string &  msg,
const std::string &  origin 
)
virtual

Implements IIssueLogger.

Definition at line 246 of file IssueLogger.cpp.

247  {
248 
249  if ( lev < m_reportLevel) return;
250 
251  std::string msg = m_levelTrans[lev] + " " + org + " \"" + str + "\"";
252 
253  if (m_showTime) {
254  msg += " [" + Gaudi::Time::current().format(true, "%H:%M:%S %Y/%m/%d %Z") +"]";
255  }
256 
257  if (lev >= m_traceLevel) {
258  std::string stack;
259  getTraceBack(stack);
260  msg += "\n" + stack;
261  }
262 
263 
264  m_log[lev](msg);
265 
266 
267 }
std::map< IssueSeverity::Level, std::string > m_levelTrans
Definition: IssueLogger.h:46
static Time current(void)
Returns the current time.
Definition: Time.cpp:114
IssueSeverity::Level m_reportLevel
Definition: IssueLogger.h:39
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
void getTraceBack(std::string &stack)
boost::function< void(const std::string &)> m_log[IssueSeverity::NUM_LEVELS]
Definition: IssueLogger.h:42
IssueSeverity::Level m_traceLevel
Definition: IssueLogger.h:39
BooleanProperty m_showTime
Definition: IssueLogger.h:37
std::string format(bool local, std::string spec="%c") const
Format the time using strftime.
Definition: Time.cpp:280
void IssueLogger::report ( const IssueSeverity err)
virtual

Implements IIssueLogger.

Definition at line 274 of file IssueLogger.cpp.

274  {
275 
276  report(err.getLevel(), err.getMsg(), err.getOrigin());
277 
278 }
std::string getOrigin() const
void report(IssueSeverity::Level level, const std::string &msg, const std::string &origin)
IssueSeverity::Level getLevel() const
Definition: IssueSeverity.h:82
std::string getMsg() const
Definition: IssueSeverity.h:83
void IssueLogger::setupDefaultLogger ( )
private

Definition at line 355 of file IssueLogger.cpp.

355  {
356  for (int i=1; i<IssueSeverity::NUM_LEVELS; ++i) {
357  if (m_logger[i] == 0) {
358  // default: dump to msgSvc
360 
361  m_logger[j] = new StreamLogger(msgSvc(), m_sevMsgMap[j]);
362  m_log[j] = boost::bind(&StreamLogger::WriteToMsgSvc, m_logger[j],
363  _1);
364 
365  MsgStream log ( msgSvc(), name() );
366  log << MSG::DEBUG << "Writing " << m_levelTrans[j]
367  << " issues to " << m_logger[j]->name() << endmsg;
368 
369  }
370  }
371 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
std::map< IssueSeverity::Level, std::string > m_levelTrans
Definition: IssueLogger.h:46
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
StreamLogger * m_logger[IssueSeverity::NUM_LEVELS]
Definition: IssueLogger.h:41
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
void WriteToMsgSvc(const std::string &str)
Definition: StreamLogger.h:22
boost::function< void(const std::string &)> m_log[IssueSeverity::NUM_LEVELS]
Definition: IssueLogger.h:42
std::string name() const
std::map< IssueSeverity::Level, MSG::Level > m_sevMsgMap
Definition: IssueLogger.h:45
list i
Definition: ana.py:128
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
void IssueLogger::setupLevels ( Property prop)
private

Definition at line 283 of file IssueLogger.cpp.

283  {
284 
285 
286  StringProperty *sap = dynamic_cast<StringProperty*> (&prop);
287  if (sap == 0) {
288  MsgStream log ( msgSvc(), name() );
289  log << MSG::ERROR << "Could not convert " << prop.name()
290  << "to a StringProperty (which it should be!)" << endmsg;
291  return;
292  }
293 
294  std::string val = sap->value();
295 
296  if (prop.name() == "ReportLevel") {
297  if (m_levelSTrans.find(val) == m_levelSTrans.end()) {
298  MsgStream log ( msgSvc(), name() );
299  log << MSG::ERROR
300  << "Option ReportLevel: unknown Issue Severity level \""
301  << val << "\". Setting it WARNING" << endmsg;
303  return;
304  } else {
306  }
307  } else if (prop.name() == "TracebackLevel") {
308  if (m_levelSTrans.find(val) == m_levelSTrans.end()) {
309  MsgStream log ( msgSvc(), name() );
310  log << MSG::ERROR
311  << "Option TracebackLevel: unknown Issue Severity level \""
312  << val << "\". Setting it to ERROR" << endmsg;
314  return;
315  } else {
317  }
318  } else {
319  MsgStream log ( msgSvc(), name() );
320  log << MSG::ERROR << "setting up unknown property \"" << prop.name()
321  << "\"" << endmsg;
322  return;
323  }
324 
325 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
const std::string & name() const
property name
Definition: Property.h:47
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
std::map< std::string, IssueSeverity::Level > m_levelSTrans
Definition: IssueLogger.h:47
IssueSeverity::Level m_reportLevel
Definition: IssueLogger.h:39
StringProperty m_reportLevelS
Definition: IssueLogger.h:36
const TYPE & value() const
explicit conversion
Definition: Property.h:355
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
IssueSeverity::Level m_traceLevel
Definition: IssueLogger.h:39
StringProperty m_traceLevelS
Definition: IssueLogger.h:36
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
void IssueLogger::setupStreams ( Property prop)
private

Definition at line 330 of file IssueLogger.cpp.

330  {
331 
332  StringArrayProperty *sap = dynamic_cast<StringArrayProperty*>( &prop );
333  if (sap == 0) {
334  MsgStream log ( msgSvc(), name() );
335  log << MSG::ERROR << "Could not convert " << prop.name()
336  << "to a StringArrayProperty (which it should be!)" << endmsg;
337  return;
338  }
339 
340  vector<string>::const_iterator itr;
341  for (itr = sap->value().begin(); itr != sap->value().end(); ++itr) {
342  if (connect(*itr).isFailure()) {
343  MsgStream log ( msgSvc(), name() );
344  log << MSG::ERROR << "Could not setup stream " << *itr << endmsg;
345  }
346  }
347 
348  return;
349 
350 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode connect(const std::string &)
const std::string & name() const
property name
Definition: Property.h:47
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:72
const TYPE & value() const
explicit conversion
Definition: Property.h:355
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MSG::Level IssueLogger::sevToMsg ( IssueSeverity::Level lev)
private

Member Data Documentation

std::map<std::string, IssueSeverity::Level> IssueLogger::m_levelSTrans
private

Definition at line 47 of file IssueLogger.h.

std::map<IssueSeverity::Level, std::string> IssueLogger::m_levelTrans
private

Definition at line 46 of file IssueLogger.h.

boost::function<void (const std::string&)> IssueLogger::m_log[IssueSeverity::NUM_LEVELS]
private

Definition at line 42 of file IssueLogger.h.

StreamLogger* IssueLogger::m_logger[IssueSeverity::NUM_LEVELS]
private

Definition at line 41 of file IssueLogger.h.

std::map<MSG::Level, IssueSeverity::Level> IssueLogger::m_msgSevMap
private

Definition at line 44 of file IssueLogger.h.

StringArrayProperty IssueLogger::m_outputfile
private

Definition at line 35 of file IssueLogger.h.

IssueSeverity::Level IssueLogger::m_reportLevel
private

Definition at line 39 of file IssueLogger.h.

StringProperty IssueLogger::m_reportLevelS
private

Definition at line 36 of file IssueLogger.h.

std::map<IssueSeverity::Level, MSG::Level> IssueLogger::m_sevMsgMap
private

Definition at line 45 of file IssueLogger.h.

BooleanProperty IssueLogger::m_showTime
private

Definition at line 37 of file IssueLogger.h.

IssueSeverity::Level IssueLogger::m_traceLevel
private

Definition at line 39 of file IssueLogger.h.

StringProperty IssueLogger::m_traceLevelS
private

Definition at line 36 of file IssueLogger.h.


The documentation for this class was generated from the following files: