29 const char gkIndent[] = {ci,ci,ci,ci,ci,ci,ci,ci,ci,ci};
32 const char gLevel[] = {
'E',
'w',
'i',
'o'};
37 short LogMessage::gkMaxDepth = 5;
38 short LogMessage::gkAutoClear = 7;
40 short LogMessage::gDebug = 0;
45 fProcessMethodTicket(
""),
71 if ( global_debug_level < 0 )
74 gDebug = global_debug_level;
79 gkMaxDepth = max_indent;
81 if ( max_before_clear <= gkMaxDepth )
82 gkAutoClear = gkMaxDepth + 2;
84 gkAutoClear = max_before_clear;
89 if ( global_debug_level < 0 )
92 gDebug = global_debug_level;
98 if ( fIndentation < gkMaxDepth )
102 if ( fRealIndentation > gkAutoClear ) {
103 std::string
tmp = fProcessMethod; fProcessMethod = fProcessMethodTicket;
105 (*this) <<
"Automatic clear called since max value for depth calls "
106 << gkAutoClear <<
" reached. Probably a missing SetProcessMethod()/dolog bracket " <<
nline;
109 fProcessMethod =
tmp;
112 else fRealIndentation++;
120 fLowestLevel =
kInfo;
122 fIndentation = fRealIndentation = 0; fIsANewLine =
true;
128 if ( fIndentation ) {
137 if ( lev == fLevel && verbosity == fVerbosity )
140 fLevel = lev; fVerbosity = verbosity;
142 if ( fLevel < fLowestLevel )
143 fLowestLevel = fLevel;
149 (*this) <<
"|" << gLevel[fLevel] <<
"," << fVerbosity <<
"|" <<
nline;
155 fProcessMethodTicket = fProcessMethod;
158 fHeader <<
"[+[#" << fTicketNumber <<
"] |" << gLevel[fLevel] <<
"," << fVerbosity <<
"| "
163 fFooter <<
"[-[#" << fTicketNumber <<
"] "
167 fIndentation = fRealIndentation = 0;
173 if ( fIndentation == 0 ) {
174 fProcessMethod = method;
178 fProcessMethod = method;
181 (*this) <<
"[" <<
" -> ::" << fProcessMethod <<
" ]" <<
nline;
193 if ( fIndentation == 0 )
196 if ( fIndentation == 1 ) {
209 o.write(gkIndent,fIndentation);
214 o <<
"--------------------------------------------------------------------------------\n";
258 if ( log.fIsANewLine )
261 log.fCoreMsg <<
"\n"; log.fIsANewLine =
true;
virtual void SetLevel(ELevel lev, unsigned short verbosity=0u)
To get the current level of the message.
static LogCollector * theCollector()
return the current logcollector
LogMessage & info(LogMessage &)
manipulator to modify the LogMessage
static void SetDebug(short global_debug_level=0)
virtual ~LogMessage()
should purge the message
LogMessage & clear(LogMessage &)
others
LogMessage & error(LogMessage &)
std::ostream & hline(std::ostream &)
LogMessage(const char *pname, unsigned int pid=0u)
virtual std::string & GetProcessMethod()
To get the current method.
LogMessage & debug(LogMessage &)
virtual void SetProcessMethod(const char *)
To set the current method.
virtual void DoCollect(LogMessage &)
Default, collect nothing !
LogMessage & nline(LogMessage &)
virtual void Indent()
to format the output string ... increase indent level
virtual void ClearMessage()
To clear the current message.
Base class for a Log message.
static void SetLogParameters(short global_debug_level=0, short max_indent=5, short max_before_clear=7)
to modify the global parameters
header file for ADFLogMessage.cpp
ADF::LogMessage & endl(ADF::LogMessage &log)
virtual unsigned short GetVerboseLevel() const
To get the current level of the message.
LogMessage & dolog(LogMessage &)
virtual std::string & GetProcessName()
To get the Process name.
virtual void Send()
To send the message to the log collector.
virtual void SetProcessPtr(void *address)
To set the Process address.
LogMessage & endl(LogMessage &)
friend LogMessage & nline(LogMessage &)
LogMessage & warning(LogMessage &)
virtual void DoClear()
really clear the message