All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MsgStream Class Reference

Definition of the MsgStream class used to transmit messages. More...

#include <GaudiKernel/MsgStream.h>

Collaboration diagram for MsgStream:

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, const 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 ()
 Standard destructor. More...
 
MsgStreamreport (int lvl)
 Initialize report of new message: activate if print level is sufficient. More...
 
virtual GAUDI_API MsgStreamdoOutput ()
 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 ()
 Retrieve output level. More...
 
MSG::Level currentLevel ()
 Retrieve current stream output level. More...
 
void activate ()
 Activate MsgStream. More...
 
void deactivate ()
 Deactivate MsgStream. More...
 
bool isActive () const
 Accessor: is MsgStream active. More...
 
MsgStreamflush ()
 
MsgStreamwrite (const char *buff, int len)
 
MsgStreamoperator<< (MsgStream &(*_f)(MsgStream &))
 Accept MsgStream modifiers. More...
 
MsgStreamoperator<< (std::ostream &(*_f)(std::ostream &))
 Accept oMsgStream modifiers. More...
 
MsgStreamoperator<< (std::ios &(*_f)(std::ios &))
 Accept ios modifiers. More...
 
MsgStreamoperator<< (MSG::Level level)
 Accept MsgStream activation using MsgStreamer operator. More...
 
MsgStreamoperator<< (longlong arg)
 
MsgStreamoperator<< (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

IMessageSvcm_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
 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...
 
IInactiveMessageCounterm_inactCounter
 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
 

Detailed Description

Definition of the MsgStream class used to transmit messages.

This class is intended to ease the use of error logging to the message service

Author
M.Frank
Sebastien Ponce

Definition at line 24 of file MsgStream.h.

Member Typedef Documentation

typedef std::ios_base::fmtflags MsgStream::FLAG_TYPE
private

Error return code in case ios modification is requested for inactive streams.

Definition at line 29 of file MsgStream.h.

typedef std::ios_base::iostate MsgStream::STATE_TYPE
private

Definition at line 30 of file MsgStream.h.

Constructor & Destructor Documentation

MsgStream::MsgStream ( IMessageSvc svc,
int  buffer_length = 128 
)

Standard constructor: Connect to message service for output.

Definition at line 43 of file MsgStream.cpp.

44 : m_service(svc),
45  m_source(""),
46  m_active(false),
48 {
49  setLevel((0==svc) ? MSG::INFO : svc->outputLevel());
50  m_useColors = (0==svc) ? false : svc->useColor();
51 #ifndef NDEBUG
52  m_inactCounter = svc ? Gaudi::Cast<IInactiveMessageCounter>(svc) : 0;
53 #endif
54 }
bool m_useColors
use colors
Definition: MsgStream.h:47
IMessageSvc * m_service
Pointer to message service if buffer has send.
Definition: MsgStream.h:33
std::string m_source
Use std::string for source information to be passed to the message service.
Definition: MsgStream.h:37
virtual int outputLevel() const =0
Retrieve the current output level threshold.
bool m_active
Flag set to true if formatting engine is active.
Definition: MsgStream.h:41
virtual bool useColor() const =0
Show whether colors are used.
void setLevel(int level)
Update outputlevel.
Definition: MsgStream.h:105
IInactiveMessageCounter * m_inactCounter
Pointer to service counting messages prepared but not printed because of wrong level.
Definition: MsgStream.h:50
MsgStream::MsgStream ( IMessageSvc svc,
const std::string &  source,
int  buffer_length = 128 
)

Standard constructor: Connect to message service for output.

Definition at line 56 of file MsgStream.cpp.

57 : m_service(svc),
58  m_source(source),
59  m_active(false),
61 {
62  setLevel((0==svc) ? MSG::INFO : svc->outputLevel(source));
63  m_useColors = (0==svc) ? false : svc->useColor();
64 #ifndef NDEBUG
65  m_inactCounter = svc ? Gaudi::Cast<IInactiveMessageCounter>(svc) : 0;
66 #endif
67 }
bool m_useColors
use colors
Definition: MsgStream.h:47
IMessageSvc * m_service
Pointer to message service if buffer has send.
Definition: MsgStream.h:33
std::string m_source
Use std::string for source information to be passed to the message service.
Definition: MsgStream.h:37
virtual int outputLevel() const =0
Retrieve the current output level threshold.
bool m_active
Flag set to true if formatting engine is active.
Definition: MsgStream.h:41
virtual bool useColor() const =0
Show whether colors are used.
void setLevel(int level)
Update outputlevel.
Definition: MsgStream.h:105
IInactiveMessageCounter * m_inactCounter
Pointer to service counting messages prepared but not printed because of wrong level.
Definition: MsgStream.h:50
MsgStream::MsgStream ( const MsgStream msg)
inline

Copy constructor.

Definition at line 60 of file MsgStream.h.

61  : m_service(msg.m_service),
62  m_active(msg.m_active),
63  m_level(msg.m_level),
66  {
67  try { // ignore exception if we cannot copy the string
68  m_source = msg.m_source;
69  }
70  catch (...) {}
71  }
bool m_useColors
use colors
Definition: MsgStream.h:47
IMessageSvc * m_service
Pointer to message service if buffer has send.
Definition: MsgStream.h:33
std::string m_source
Use std::string for source information to be passed to the message service.
Definition: MsgStream.h:37
MSG::Level m_level
Debug level of the message service.
Definition: MsgStream.h:43
bool m_active
Flag set to true if formatting engine is active.
Definition: MsgStream.h:41
IInactiveMessageCounter * m_inactCounter
Pointer to service counting messages prepared but not printed because of wrong level.
Definition: MsgStream.h:50
MsgStream::~MsgStream ( )
virtual

Standard destructor.

Definition at line 69 of file MsgStream.cpp.

69  {
70 }

Member Function Documentation

void MsgStream::activate ( )
inline

Activate MsgStream.

Definition at line 119 of file MsgStream.h.

119  {
120  m_active = true;
121  }
bool m_active
Flag set to true if formatting engine is active.
Definition: MsgStream.h:41
int MsgStream::bad ( ) const
inline

Definition at line 212 of file MsgStream.h.

212  {
213  return isActive() ? m_stream.bad() : 0;
214  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
const std::string& MsgStream::buffer ( ) const
inline

Access string buffer.

Definition at line 93 of file MsgStream.h.

93  {
94  return m_buffer;
95  }
std::string m_buffer
Use standard string for information buffering.
Definition: MsgStream.h:35
void MsgStream::clear ( STATE_TYPE  _i = std::ios_base::failbit)
inline

Definition at line 221 of file MsgStream.h.

221  {
222  if ( isActive() ) m_stream.clear(_i);
223  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
bool MsgStream::countInactive ( )
static

Returns the state of the counting of inactive messages (enabled/disabled).

Definition at line 38 of file MsgStream.cpp.

38  {
39  return m_countInactive;
40 }
static bool m_countInactive
Flag to state if the inactive messages has to be counted.
Definition: MsgStream.h:52
MSG::Level MsgStream::currentLevel ( )
inline

Retrieve current stream output level.

Definition at line 115 of file MsgStream.h.

115  {
116  return m_currLevel;
117  }
MSG::Level m_currLevel
Current debug level.
Definition: MsgStream.h:45
void MsgStream::deactivate ( )
inline

Deactivate MsgStream.

Definition at line 123 of file MsgStream.h.

123  {
124  m_active = false;
125  }
bool m_active
Flag set to true if formatting engine is active.
Definition: MsgStream.h:41
MsgStream & MsgStream::doOutput ( )
virtual

Output method.

Definition at line 72 of file MsgStream.cpp.

72  {
73  try {
74  // This piece of code may throw and we cannot afford it when we print a message
75  // in the middle of a catch block.
76  if ( isActive() ) {
78  if ( m_service != 0 ) {
80  }
81  else {
82  std::cout << msg << std::endl;
83  }
84  }
85  m_stream.str("");
86  } catch(...) {}
87  return *this;
88 }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
IMessageSvc * m_service
Pointer to message service if buffer has send.
Definition: MsgStream.h:33
std::string m_source
Use std::string for source information to be passed to the message service.
Definition: MsgStream.h:37
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
MSG::Level m_currLevel
Current debug level.
Definition: MsgStream.h:45
The Message class.
Definition: Message.h:15
virtual void reportMessage(const Message &msg, int outputLevel)=0
Report a message by sending a Message object to the message service.
bool MsgStream::enableCountInactive ( bool  value = true)
static

Enable/disable the count of inactive messages.

Returns the previous state.

Definition at line 32 of file MsgStream.cpp.

32  {
33  bool old = m_countInactive;
35  return old;
36 }
static bool m_countInactive
Flag to state if the inactive messages has to be counted.
Definition: MsgStream.h:52
int MsgStream::eof ( ) const
inline

Definition at line 209 of file MsgStream.h.

209  {
210  return isActive() ? m_stream.eof () : 0;
211  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
char MsgStream::fill ( ) const
inline

Definition at line 191 of file MsgStream.h.

191  {
192  return isActive() ? m_stream.fill() : (char)-1;
193  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
char MsgStream::fill ( char  v)
inline

Definition at line 194 of file MsgStream.h.

194  {
195  return isActive() ? m_stream.fill(v) : (char)-1;
196  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
long MsgStream::flags ( ) const
inline

IOS emulation.

Definition at line 176 of file MsgStream.h.

176  {
177  return isActive() ? m_stream.flags() : 0;
178  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
long MsgStream::flags ( FLAG_TYPE  v)
inline

Definition at line 179 of file MsgStream.h.

179  {
180  return isActive() ? m_stream.flags(v) : 0;
181  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
MsgStream& MsgStream::flush ( )
inline

Definition at line 131 of file MsgStream.h.

131  {
132  if ( isActive() ) m_stream.flush();
133  return *this;
134  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
int MsgStream::good ( ) const
inline

Definition at line 206 of file MsgStream.h.

206  {
207  return isActive() ? m_stream.good () : 0;
208  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
bool MsgStream::isActive ( ) const
inline

Accessor: is MsgStream active.

Definition at line 127 of file MsgStream.h.

127  {
128  return m_active;
129  }
bool m_active
Flag set to true if formatting engine is active.
Definition: MsgStream.h:41
MSG::Level MsgStream::level ( )
inline

Retrieve output level.

Definition at line 111 of file MsgStream.h.

111  {
112  return m_level;
113  }
MSG::Level m_level
Debug level of the message service.
Definition: MsgStream.h:43
MsgStream& MsgStream::operator<< ( MsgStream &(*)(MsgStream &)  _f)
inline

Accept MsgStream modifiers.

Definition at line 141 of file MsgStream.h.

141  {
142  if ( isActive() ) _f(*this);
143  return *this;
144  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
MsgStream& MsgStream::operator<< ( std::ostream &(*)(std::ostream &)  _f)
inline

Accept oMsgStream modifiers.

Definition at line 146 of file MsgStream.h.

146  {
147  if ( isActive() ) _f(m_stream);
148  return *this;
149  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
MsgStream& MsgStream::operator<< ( std::ios &(*)(std::ios &)  _f)
inline

Accept ios modifiers.

Definition at line 151 of file MsgStream.h.

151  {
152  if ( isActive() ) _f(m_stream);
153  return *this;
154  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
MsgStream& MsgStream::operator<< ( MSG::Level  level)
inline

Accept MsgStream activation using MsgStreamer operator.

Definition at line 156 of file MsgStream.h.

156  {
157  return report(level);
158  }
MSG::Level level()
Retrieve output level.
Definition: MsgStream.h:111
MsgStream & report(int lvl)
Initialize report of new message: activate if print level is sufficient.
Definition: MsgStream.h:75
MsgStream& MsgStream::operator<< ( longlong  arg)
inline

Definition at line 159 of file MsgStream.h.

159  {
160  try {
161  // this may throw, and we cannot afford it if the stream is used in a catch block
162  if(isActive()) {
163  m_stream << arg;
164  }
165  } catch (...) {}
166  return *this;
167  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
MsgStream& MsgStream::operator<< ( std::ios_base &(*)(std::ios_base &)  _f)
inline

Accept ios base class modifiers.

Definition at line 170 of file MsgStream.h.

170  {
171  if ( isActive() ) _f(m_stream);
172  return *this;
173  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
int MsgStream::precision ( ) const
inline

Definition at line 197 of file MsgStream.h.

197  {
198  return isActive() ? m_stream.precision(): 0;
199  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
int MsgStream::precision ( int  v)
inline

Definition at line 200 of file MsgStream.h.

200  {
201  return isActive() ? m_stream.precision(v): 0;
202  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
int MsgStream::rdstate ( ) const
inline

Definition at line 203 of file MsgStream.h.

203  {
204  return isActive() ? m_stream.rdstate () : std::ios_base::failbit;
205  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
MsgStream& MsgStream::report ( int  lvl)
inline

Initialize report of new message: activate if print level is sufficient.

Definition at line 75 of file MsgStream.h.

75  {
76  lvl = (lvl >= MSG::NUM_LEVELS) ?
77  MSG::ALWAYS : (lvl<MSG::NIL) ? MSG::NIL : lvl;
78  if ((m_currLevel=MSG::Level(lvl)) >= level()) {
79  activate();
80  } else {
81  deactivate();
82 #ifndef NDEBUG
85  }
86 #endif
87  }
88  return *this;
89  }
MSG::Level level()
Retrieve output level.
Definition: MsgStream.h:111
virtual void incrInactiveCount(MSG::Level level, const std::string &src)=0
Increment deactivated message count.
std::string m_source
Use std::string for source information to be passed to the message service.
Definition: MsgStream.h:37
void deactivate()
Deactivate MsgStream.
Definition: MsgStream.h:123
MSG::Level m_currLevel
Current debug level.
Definition: MsgStream.h:45
void activate()
Activate MsgStream.
Definition: MsgStream.h:119
IInactiveMessageCounter * m_inactCounter
Pointer to service counting messages prepared but not printed because of wrong level.
Definition: MsgStream.h:50
static GAUDI_API bool countInactive()
Returns the state of the counting of inactive messages (enabled/disabled).
Definition: MsgStream.cpp:38
void MsgStream::resetColor ( )

Reset the colors to defaults.

Definition at line 117 of file MsgStream.cpp.

117  {
118 #ifndef _WIN32
119  if ( m_useColors ) {
120  try { // this may throw and we must not do it
121  m_stream << "\x1b[m" << m_service->getLogColor(m_currLevel);
122  }
123  catch(...) {}
124  }
125 #endif
126 }
bool m_useColors
use colors
Definition: MsgStream.h:47
IMessageSvc * m_service
Pointer to message service if buffer has send.
Definition: MsgStream.h:33
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
MSG::Level m_currLevel
Current debug level.
Definition: MsgStream.h:45
virtual std::string getLogColor(int logLevel) const =0
Get the color codes for various log levels.
void MsgStream::setColor ( MSG::Color  col)

Set the text color.

Definition at line 90 of file MsgStream.cpp.

90  {
91 #ifndef _WIN32
92  if ( m_useColors) {
93  int fc = 90 + col;
94  try { // this may throw and we must not do it
95  m_stream << "\x1b[" << fc << ";1m";
96  }
97  catch(...) {}
98  }
99 #endif
100 }
bool m_useColors
use colors
Definition: MsgStream.h:47
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
void MsgStream::setColor ( MSG::Color  fg,
MSG::Color  bg 
)

Set the foreground and background colors.

Definition at line 102 of file MsgStream.cpp.

102  {
103 #ifndef _WIN32
104  if ( m_useColors ) {
105  try { // this may throw and we must not do it
106  int fc = 90 + fg;
107  m_stream << "\x1b[" << fc;
108  int bc = 100 + bg;
109  m_stream << ";" << bc;
110  m_stream << ";1m";
111  }
112  catch(...) {}
113  }
114 #endif
115 }
bool m_useColors
use colors
Definition: MsgStream.h:47
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
long MsgStream::setf ( FLAG_TYPE  v)
inline

Definition at line 182 of file MsgStream.h.

182  {
183  return isActive() ? m_stream.setf(v) : 0;
184  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
long MsgStream::setf ( FLAG_TYPE  _f,
FLAG_TYPE  _m 
)
inline

Definition at line 215 of file MsgStream.h.

215  {
216  return isActive() ? m_stream.setf(_f, _m) : 0;
217  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
void MsgStream::setLevel ( int  level)
inline

Update outputlevel.

Definition at line 105 of file MsgStream.h.

105  {
106  level = (level >= MSG::NUM_LEVELS) ?
109  }
MSG::Level level()
Retrieve output level.
Definition: MsgStream.h:111
MSG::Level m_level
Debug level of the message service.
Definition: MsgStream.h:43
void MsgStream::setMsgSvc ( IMessageSvc svc)
inline

Update IMessageSvc pointer.

Definition at line 101 of file MsgStream.h.

101  {
102  m_service = svc;
103  }
IMessageSvc * m_service
Pointer to message service if buffer has send.
Definition: MsgStream.h:33
std::ostringstream& MsgStream::stream ( )
inline

Access string MsgStream.

Definition at line 97 of file MsgStream.h.

97  {
98  return m_stream;
99  }
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
void MsgStream::unsetf ( FLAG_TYPE  _l)
inline

Definition at line 218 of file MsgStream.h.

218  {
219  if ( isActive() ) m_stream.unsetf(_l);
220  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
int MsgStream::width ( ) const
inline

Definition at line 185 of file MsgStream.h.

185  {
186  return isActive() ? m_stream.width() : 0;
187  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
int MsgStream::width ( int  v)
inline

Definition at line 188 of file MsgStream.h.

188  {
189  return isActive() ? m_stream.width(v) : 0;
190  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39
MsgStream& MsgStream::write ( const char *  buff,
int  len 
)
inline

Definition at line 136 of file MsgStream.h.

136  {
137  if ( isActive() ) m_stream.write(buff, len);
138  return *this;
139  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:127
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:39

Member Data Documentation

bool MsgStream::m_active
protected

Flag set to true if formatting engine is active.

Definition at line 41 of file MsgStream.h.

std::string MsgStream::m_buffer
protected

Use standard string for information buffering.

Definition at line 35 of file MsgStream.h.

bool MsgStream::m_countInactive = false
staticprotected

Flag to state if the inactive messages has to be counted.

Definition at line 52 of file MsgStream.h.

MSG::Level MsgStream::m_currLevel
protected

Current debug level.

Definition at line 45 of file MsgStream.h.

IInactiveMessageCounter* MsgStream::m_inactCounter
protected

Pointer to service counting messages prepared but not printed because of wrong level.

Definition at line 50 of file MsgStream.h.

MSG::Level MsgStream::m_level
protected

Debug level of the message service.

Definition at line 43 of file MsgStream.h.

IMessageSvc* MsgStream::m_service
protected

Pointer to message service if buffer has send.

Definition at line 33 of file MsgStream.h.

std::string MsgStream::m_source
protected

Use std::string for source information to be passed to the message service.

Definition at line 37 of file MsgStream.h.

std::ostringstream MsgStream::m_stream
protected

String MsgStream associated to buffer.

Definition at line 39 of file MsgStream.h.

bool MsgStream::m_useColors
protected

use colors

Definition at line 47 of file MsgStream.h.


The documentation for this class was generated from the following files: