Base class for a Log message. More...
#include <ADFLogMessage.h>
Public Types | |
enum | ELevel { kError, kWarning, kInfo, kOut } |
message level More... | |
Public Member Functions | |
virtual void | ClearMessage () |
To clear the current message. More... | |
virtual std::string | Footer () const |
To get the Footer of the current message. More... | |
virtual ELevel | GetLevel () const |
To get the current level of the message. More... | |
virtual ELevel | GetLowestLevel () const |
To get the current level of the message. More... | |
virtual unsigned int | GetPID () const |
To get the Process ID number. More... | |
virtual std::string & | GetProcessMethod () |
To get the current method. More... | |
virtual std::string & | GetProcessName () |
To get the Process name. More... | |
virtual unsigned short | GetVerboseLevel () const |
To get the current level of the message. More... | |
virtual std::string | Header () const |
To get the header of the current message. More... | |
bool | IsDebug (short debug_to_test) const |
to test if the required debug level is lower that the global one More... | |
LogMessage (const char *pname, unsigned int pid=0u) | |
virtual std::string | Message () const |
To get the current message. More... | |
virtual std::ostringstream & | operator() () |
Allow to pass the underlying stream to funtions/methods. More... | |
virtual LogMessage & | operator<< (LogMessage &(*pf)(LogMessage &)) |
To allow manipulators. More... | |
template<class T > | |
LogMessage & | operator<< (T t) |
send any request to the underlying ostringstream More... | |
virtual void | Send () |
To send the message to the log collector. More... | |
virtual void | SetLevel (ELevel lev, unsigned short verbosity=0u) |
To get the current level of the message. More... | |
virtual void | SetPID (unsigned int pid) |
To set the Process ID number. More... | |
virtual void | SetProcessMethod (const char *) |
To set the current method. More... | |
virtual void | SetProcessPtr (void *address) |
To set the Process address. More... | |
virtual void | SetVerboseLevel (unsigned short verbosity) |
To get the current level of the message. More... | |
virtual | ~LogMessage () |
should purge the message More... | |
Static Public Member Functions | |
static void | SetDebug (short global_debug_level=0) |
static void | SetLogParameters (short global_debug_level=0, short max_indent=5, short max_before_clear=7) |
to modify the global parameters More... | |
Protected Member Functions | |
virtual void | DoClear () |
really clear the message More... | |
virtual void | Indent () |
to format the output string ... increase indent level More... | |
virtual void | Indent (std::ostream &) |
indent an ostream More... | |
void | NewTicket () |
Friends | |
LogMessage & | clear (LogMessage &) |
others More... | |
LogMessage & | debug (LogMessage &) |
LogMessage & | dolog (LogMessage &) |
LogMessage & | endl (LogMessage &) |
LogMessage & | error (LogMessage &) |
LogMessage & | info (LogMessage &) |
manipulator to modify the LogMessage More... | |
LogMessage & | nline (LogMessage &) |
LogMessage & | sep (LogMessage &) |
LogMessage & | warning (LogMessage &) |
Base class for a Log message.
A log message helps to send messages to a LogCollector. Depending of the current collector, the message could be treated differently (print out on the standard output, send it to a server etc ...).
A Process name, a process method and a process id (unsigned int) are associated to a LogMessage and can be changed with GetProcessName(), GetProcessMethod() and SetPID(). As well an address could be set to allow the separation between identical processes. By default it is the pointer on the allocated LogMessage but it could be configured by the user with SetProcessPtr
A log message has a level and a verbosity. Currently defined:
The default value for the verbosity is 0. Use SetLevel to change the values.
Any basic type could be written in a log message. Here are some illustrations
Definition at line 80 of file ADFLogMessage.h.