18 #define KERNEL_MSGSTREAM_CPP
21 #include "GaudiKernel/MsgStream.h"
22 #include "GaudiKernel/Message.h"
23 #include "GaudiKernel/GaudiException.h"
24 #include "GaudiKernel/IMessageSvc.h"
49 m_inactCounter = svc ? Gaudi::Cast<IInactiveMessageCounter>(svc) : 0;
55 m_source(
std::move(source))
60 m_inactCounter = svc ? Gaudi::Cast<IInactiveMessageCounter>(svc) : 0;
73 std::cout <<
msg << std::endl;
119 std::string
format(
const char* fmt, ... )
121 const int buffsize = 2048;
122 static char buffer[buffsize];
124 va_start( arguments, fmt );
125 if( vsnprintf(buffer, buffsize, fmt, arguments) >= buffsize )
129 return std::string(buffer);
std::string format(const char *fmt,...)
MsgStream format utility "a la sprintf(...)".
IMessageSvc * m_service
Pointer to message service if buffer has send.
Definition of the MsgStream class used to transmit messages.
string to_string(const T &value)
Define general base for Gaudi exception.
bool m_useColors
use colors
GAUDI_API void resetColor()
Reset the colors to defaults.
bool isActive() const
Accessor: is MsgStream active.
virtual GAUDI_API MsgStream & doOutput()
Output method.
static bool m_countInactive
Flag to state if the inactive messages has to be counted.
IInactiveMessageCounter * m_inactCounter
Pointer to service counting messages prepared but not printed because of wrong level.
std::string m_source
Use std::string for source information to be passed to the message service.
GAUDI_API void setColor(MSG::Color col)
Set the text color.
virtual int outputLevel() const =0
Retrieve the current output level threshold.
std::ostringstream m_stream
String MsgStream associated to buffer.
The IMessage is the interface implemented by the message service.
MSG::Level m_currLevel
Current debug level.
virtual std::string getLogColor(int logLevel) const =0
Get the color codes for various log levels.
GAUDI_API MsgStream(IMessageSvc *svc, int buffer_length=128)
Standard constructor: Connect to message service for output.
virtual bool useColor() const =0
Show whether colors are used.
void setLevel(int level)
Update outputlevel.
virtual void reportMessage(const Message &msg, int outputLevel)=0
Report a message by sending a Message object to the message service.
static GAUDI_API bool enableCountInactive(bool value=true)
Enable/disable the count of inactive messages.
static GAUDI_API bool countInactive()
Returns the state of the counting of inactive messages (enabled/disabled).