The Gaudi Framework
v30r3 (a5ef0a68)
|
Definition of the MsgStream class used to transmit messages. More...
#include <GaudiKernel/MsgStream.h>
Public Member Functions | |
GAUDI_API | MsgStream (IMessageSvc *svc, int buffer_length=128) |
Standard constructor: Connect to message service for output. More... | |
GAUDI_API | MsgStream (IMessageSvc *svc, std::string source, int buffer_length=128) |
Standard constructor: Connect to message service for output. More... | |
MsgStream (const MsgStream &msg) | |
Copy constructor. More... | |
virtual GAUDI_API | ~MsgStream ()=default |
Standard destructor. More... | |
MsgStream & | report (int lvl) |
Initialize report of new message: activate if print level is sufficient. More... | |
virtual GAUDI_API MsgStream & | doOutput () |
Output method. More... | |
const std::string & | buffer () const |
Access string buffer. More... | |
std::ostringstream & | stream () |
Access string MsgStream. More... | |
void | setMsgSvc (IMessageSvc *svc) |
Update IMessageSvc pointer. More... | |
void | setLevel (int level) |
Update outputlevel. More... | |
MSG::Level | level () const |
Retrieve output level. More... | |
MSG::Level | currentLevel () const |
Retrieve current stream output level. More... | |
void | activate () |
Activate MsgStream. More... | |
void | deactivate () |
Deactivate MsgStream. More... | |
bool | isActive () const |
Accessor: is MsgStream active. More... | |
MsgStream & | flush () |
MsgStream & | write (const char *buff, int len) |
MsgStream & | operator<< (MsgStream &(*_f)(MsgStream &)) |
Accept MsgStream modifiers. More... | |
MsgStream & | operator<< (std::ostream &(*_f)(std::ostream &)) |
Accept oMsgStream modifiers. More... | |
MsgStream & | operator<< (std::ios &(*_f)(std::ios &)) |
Accept ios modifiers. More... | |
MsgStream & | operator<< (MSG::Level level) |
Accept MsgStream activation using MsgStreamer operator. More... | |
MsgStream & | operator<< (longlong arg) |
MsgStream & | operator<< (std::ios_base &(*_f)(std::ios_base &)) |
Accept ios base class modifiers. More... | |
long | flags () const |
IOS emulation. More... | |
long | flags (FLAG_TYPE v) |
long | setf (FLAG_TYPE v) |
int | width () const |
int | width (int v) |
char | fill () const |
char | fill (char v) |
int | precision () const |
int | precision (int v) |
int | rdstate () const |
int | good () const |
int | eof () const |
int | bad () const |
long | setf (FLAG_TYPE _f, FLAG_TYPE _m) |
void | unsetf (FLAG_TYPE _l) |
void | clear (STATE_TYPE _i=std::ios_base::failbit) |
GAUDI_API void | setColor (MSG::Color col) |
Set the text color. More... | |
GAUDI_API void | setColor (MSG::Color fg, MSG::Color bg) |
Set the foreground and background colors. More... | |
GAUDI_API void | resetColor () |
Reset the colors to defaults. More... | |
Static Public Member Functions | |
static GAUDI_API bool | enableCountInactive (bool value=true) |
Enable/disable the count of inactive messages. More... | |
static GAUDI_API bool | countInactive () |
Returns the state of the counting of inactive messages (enabled/disabled). More... | |
Protected Attributes | |
IMessageSvc * | m_service |
Pointer to message service if buffer has send. More... | |
std::string | m_buffer |
Use standard string for information buffering. More... | |
std::string | m_source |
Use std::string for source information to be passed to the message service. More... | |
std::ostringstream | m_stream |
String MsgStream associated to buffer. More... | |
bool | m_active = false |
Flag set to true if formatting engine is active. More... | |
MSG::Level | m_level |
Debug level of the message service. More... | |
MSG::Level | m_currLevel |
Current debug level. More... | |
bool | m_useColors |
use colors More... | |
IInactiveMessageCounter * | m_inactCounter = nullptr |
Pointer to service counting messages prepared but not printed because of wrong level. More... | |
Static Protected Attributes | |
static bool | m_countInactive = false |
Flag to state if the inactive messages has to be counted. More... | |
Private Types | |
typedef std::ios_base::fmtflags | FLAG_TYPE |
Error return code in case ios modification is requested for inactive streams. More... | |
typedef std::ios_base::iostate | STATE_TYPE |
Definition of the MsgStream class used to transmit messages.
This class is intended to ease the use of error logging to the message service
Definition at line 24 of file MsgStream.h.
|
private |
Error return code in case ios modification is requested for inactive streams.
Definition at line 30 of file MsgStream.h.
|
private |
Definition at line 31 of file MsgStream.h.
MsgStream::MsgStream | ( | IMessageSvc * | svc, |
int | buffer_length = 128 |
||
) |
Standard constructor: Connect to message service for output.
Definition at line 40 of file MsgStream.cpp.
MsgStream::MsgStream | ( | IMessageSvc * | svc, |
std::string | source, | ||
int | buffer_length = 128 |
||
) |
Standard constructor: Connect to message service for output.
Definition at line 50 of file MsgStream.cpp.
|
inline |
Copy constructor.
Definition at line 62 of file MsgStream.h.
|
virtualdefault |
Standard destructor.
|
inline |
Activate MsgStream.
Definition at line 112 of file MsgStream.h.
|
inline |
Definition at line 181 of file MsgStream.h.
|
inline |
Access string buffer.
Definition at line 96 of file MsgStream.h.
|
inline |
Definition at line 187 of file MsgStream.h.
|
static |
Returns the state of the counting of inactive messages (enabled/disabled).
Definition at line 38 of file MsgStream.cpp.
|
inline |
|
inline |
Deactivate MsgStream.
Definition at line 114 of file MsgStream.h.
|
virtual |
Output method.
Definition at line 60 of file MsgStream.cpp.
|
static |
Enable/disable the count of inactive messages.
Returns the previous state.
Definition at line 31 of file MsgStream.cpp.
|
inline |
Definition at line 180 of file MsgStream.h.
|
inline |
Definition at line 174 of file MsgStream.h.
|
inline |
Definition at line 175 of file MsgStream.h.
|
inline |
IOS emulation.
Definition at line 169 of file MsgStream.h.
|
inline |
Definition at line 170 of file MsgStream.h.
|
inline |
Definition at line 118 of file MsgStream.h.
|
inline |
Definition at line 179 of file MsgStream.h.
|
inline |
Accessor: is MsgStream active.
Definition at line 116 of file MsgStream.h.
|
inline |
|
inline |
Accept oMsgStream modifiers.
Definition at line 136 of file MsgStream.h.
|
inline |
Accept ios modifiers.
Definition at line 142 of file MsgStream.h.
|
inline |
Accept MsgStream activation using MsgStreamer operator.
Definition at line 148 of file MsgStream.h.
Definition at line 149 of file MsgStream.h.
|
inline |
Accept ios base class modifiers.
Definition at line 162 of file MsgStream.h.
|
inline |
Definition at line 176 of file MsgStream.h.
|
inline |
Definition at line 177 of file MsgStream.h.
|
inline |
Definition at line 178 of file MsgStream.h.
|
inline |
Initialize report of new message: activate if print level is sufficient.
Definition at line 78 of file MsgStream.h.
void MsgStream::resetColor | ( | ) |
Reset the colors to defaults.
Definition at line 108 of file MsgStream.cpp.
void MsgStream::setColor | ( | MSG::Color | col | ) |
Set the text color.
Definition at line 79 of file MsgStream.cpp.
void MsgStream::setColor | ( | MSG::Color | fg, |
MSG::Color | bg | ||
) |
Set the foreground and background colors.
Definition at line 92 of file MsgStream.cpp.
|
inline |
Definition at line 171 of file MsgStream.h.
Definition at line 182 of file MsgStream.h.
|
inline |
Update outputlevel.
Definition at line 102 of file MsgStream.h.
|
inline |
Update IMessageSvc
pointer.
Definition at line 100 of file MsgStream.h.
|
inline |
Access string MsgStream.
Definition at line 98 of file MsgStream.h.
|
inline |
Definition at line 183 of file MsgStream.h.
|
inline |
Definition at line 172 of file MsgStream.h.
|
inline |
Definition at line 173 of file MsgStream.h.
|
inline |
Definition at line 124 of file MsgStream.h.
|
protected |
Flag set to true if formatting engine is active.
Definition at line 43 of file MsgStream.h.
|
protected |
Use standard string for information buffering.
Definition at line 37 of file MsgStream.h.
|
staticprotected |
Flag to state if the inactive messages has to be counted.
Definition at line 54 of file MsgStream.h.
|
protected |
Current debug level.
Definition at line 47 of file MsgStream.h.
|
protected |
Pointer to service counting messages prepared but not printed because of wrong level.
Definition at line 52 of file MsgStream.h.
|
protected |
Debug level of the message service.
Definition at line 45 of file MsgStream.h.
|
protected |
Pointer to message service if buffer has send.
Definition at line 35 of file MsgStream.h.
|
protected |
Use std::string for source information to be passed to the message service.
Definition at line 39 of file MsgStream.h.
|
protected |
String MsgStream associated to buffer.
Definition at line 41 of file MsgStream.h.
|
protected |
use colors
Definition at line 49 of file MsgStream.h.