13 #include "boost/bind.hpp"
22 std::transform(s.begin(), s.end(), s.begin(),
149 const int depth = 30;
150 const int offset = 5;
162 string::size_type loc = ident.find(
" ");
166 string val,VAL,TAG,filename;
168 tok.
analyse(ident.substr(loc+1,ident.length()),
" ",
"",
"",
"=",
"'",
"'");
170 for ( Tokenizer::Items::iterator
i = tok.
items().begin();
172 const std::string& tag = (*i).tag();
182 if (TAG ==
"DEBUG") {
184 }
else if ( TAG ==
"INFO") {
186 }
else if ( TAG ==
"WARNING") {
188 }
else if ( TAG ==
"RECOVERABLE") {
190 }
else if ( TAG ==
"ERROR") {
192 }
else if ( TAG ==
"FATAL") {
195 log <<
MSG::ERROR <<
"Unknown output level \"" << TAG <<
"\""
207 if (val ==
"MsgSvc") {
212 }
else if (val ==
"STDERR") {
217 }
else if (val ==
"STDOUT") {
226 catch (std::exception&) {
228 log <<
MSG::ERROR <<
"Unable to open file \"" << VAL
229 <<
"\" for writing issues at level " << TAG <<
endmsg;
247 const std::string& org) {
290 <<
"to a StringProperty (which it should be!)" <<
endmsg;
294 std::string val = sap->
value();
296 if (prop.
name() ==
"ReportLevel") {
300 <<
"Option ReportLevel: unknown Issue Severity level \""
301 << val <<
"\". Setting it WARNING" <<
endmsg;
307 }
else if (prop.
name() ==
"TracebackLevel") {
311 <<
"Option TracebackLevel: unknown Issue Severity level \""
312 << val <<
"\". Setting it to ERROR" <<
endmsg;
320 log <<
MSG::ERROR <<
"setting up unknown property \"" << prop.
name()
336 <<
"to a StringArrayProperty (which it should be!)" <<
endmsg;
340 vector<string>::const_iterator itr;
341 for (itr = sap->
value().begin(); itr != sap->
value().end(); ++itr) {
Definition of the MsgStream class used to transmit messages.
std::map< IssueSeverity::Level, std::string > m_levelTrans
StatusCode connect(const std::string &)
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
std::string getOrigin() const
Items & items()
Access token collection.
const std::string & name() const
property name
void toupper(std::string &s)
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
static Time current(void)
Returns the current time.
void report(IssueSeverity::Level level, const std::string &msg, const std::string &origin)
std::map< std::string, IssueSeverity::Level > m_levelSTrans
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
StringArrayProperty m_outputfile
void analyse(const std::string &s, const char *delim, const char *tagBegin, const char *tagEnd, const char *eq, const char *valBegin, const char *valEnd)
Analyse tokens from string.
IssueSeverity::Level m_reportLevel
bool isFailure() const
Test for a status code of FAILURE.
StringProperty m_reportLevelS
GAUDI_API int backTrace(void **addresses, const int depth)
#define DECLARE_COMPONENT(type)
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
void setupDefaultLogger()
virtual void declareUpdateHandler(PropertyCallbackFunctor *pf)
set new callback for update
This class is used for returning status codes from appropriate routines.
StreamLogger * m_logger[IssueSeverity::NUM_LEVELS]
const TYPE & value() const
explicit conversion
virtual const std::string & name() const
Retrieve name of the service.
Property base class allowing Property* collections to be "homogeneous".
void getTraceBack(std::string &stack)
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
void setupStreams(Property &prop)
void setupLevels(Property &prop)
virtual StatusCode reinitialize()
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
std
AIDA -> ROTO converter.
Templated class to add the standard messaging functionalities.
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
void WriteToMsgSvc(const std::string &str)
boost::function< void(const std::string &)> m_log[IssueSeverity::NUM_LEVELS]
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
IssueSeverity::Level m_traceLevel
std::map< IssueSeverity::Level, MSG::Level > m_sevMsgMap
BooleanProperty m_showTime
std::map< MSG::Level, IssueSeverity::Level > m_msgSevMap
IssueSeverity::Level getLevel() const
StringProperty m_traceLevelS
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
void WriteToStream(const std::string &str)
std::string getMsg() const
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
std::string format(bool local, std::string spec="%c") const
Format the time using strftime.
IssueLogger(const std::string &name, ISvcLocator *svc)