Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules 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, 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...
 
MsgStreamreport (int lvl)
 Initialize report of new message: activate if print level is sufficient. More...
 
virtual GAUDI_API MsgStreamdoOutput ()
 Output method. More...
 
const std::stringbuffer () const
 Access string buffer. More...
 
std::ostringstreamstream ()
 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...
 
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<< (long long 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 = 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...
 
IInactiveMessageCounterm_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
 

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 39 of file MsgStream.cpp.

39  : m_service( svc ) {
40  setLevel( svc ? svc->outputLevel() : MSG::INFO );
42  m_useColors = ( svc ? svc->useColor() : false );
43 #ifndef NDEBUG
44  m_inactCounter = svc ? Gaudi::Cast<IInactiveMessageCounter>( svc ) : 0;
45 #endif
46 }
virtual bool useColor() const =0
Show whether colors are used.
bool m_useColors
use colors
Definition: MsgStream.h:48
IMessageSvc * m_service
Pointer to message service if buffer has send.
Definition: MsgStream.h:34
MSG::Level m_level
Debug level of the message service.
Definition: MsgStream.h:44
MSG::Level m_currLevel
Current debug level.
Definition: MsgStream.h:46
void setLevel(int level)
Update outputlevel.
Definition: MsgStream.h:98
IInactiveMessageCounter * m_inactCounter
Pointer to service counting messages prepared but not printed because of wrong level.
Definition: MsgStream.h:51
virtual int outputLevel() const =0
Retrieve the current output level threshold.
MsgStream::MsgStream ( IMessageSvc svc,
std::string  source,
int  buffer_length = 128 
)

Standard constructor: Connect to message service for output.

Definition at line 48 of file MsgStream.cpp.

48  : m_service( svc ), m_source( std::move( source ) ) {
49  setLevel( svc ? svc->outputLevel( m_source ) : MSG::INFO );
51  m_useColors = ( svc && svc->useColor() );
52 #ifndef NDEBUG
53  m_inactCounter = svc ? Gaudi::Cast<IInactiveMessageCounter>( svc ) : 0;
54 #endif
55 }
virtual bool useColor() const =0
Show whether colors are used.
bool m_useColors
use colors
Definition: MsgStream.h:48
IMessageSvc * m_service
Pointer to message service if buffer has send.
Definition: MsgStream.h:34
std::string m_source
Use std::string for source information to be passed to the message service.
Definition: MsgStream.h:38
MSG::Level m_level
Debug level of the message service.
Definition: MsgStream.h:44
T move(T...args)
MSG::Level m_currLevel
Current debug level.
Definition: MsgStream.h:46
void setLevel(int level)
Update outputlevel.
Definition: MsgStream.h:98
IInactiveMessageCounter * m_inactCounter
Pointer to service counting messages prepared but not printed because of wrong level.
Definition: MsgStream.h:51
virtual int outputLevel() const =0
Retrieve the current output level threshold.
MsgStream::MsgStream ( const MsgStream msg)
inline

Copy constructor.

Definition at line 61 of file MsgStream.h.

62  : m_service( msg.m_service )
63  , m_active( msg.m_active )
64  , m_level( msg.m_level )
65  , m_currLevel( msg.m_currLevel )
66  , m_useColors( msg.m_useColors )
68  try { // ignore exception if we cannot copy the string
69  m_source = msg.m_source;
70  } catch ( ... ) {}
71  }
bool m_useColors
use colors
Definition: MsgStream.h:48
IMessageSvc * m_service
Pointer to message service if buffer has send.
Definition: MsgStream.h:34
std::string m_source
Use std::string for source information to be passed to the message service.
Definition: MsgStream.h:38
MSG::Level m_level
Debug level of the message service.
Definition: MsgStream.h:44
bool m_active
Flag set to true if formatting engine is active.
Definition: MsgStream.h:42
MSG::Level m_currLevel
Current debug level.
Definition: MsgStream.h:46
IInactiveMessageCounter * m_inactCounter
Pointer to service counting messages prepared but not printed because of wrong level.
Definition: MsgStream.h:51
virtual GAUDI_API MsgStream::~MsgStream ( )
virtualdefault

Standard destructor.

Member Function Documentation

void MsgStream::activate ( )
inline

Activate MsgStream.

Definition at line 107 of file MsgStream.h.

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

Definition at line 166 of file MsgStream.h.

166 { return isActive() ? m_stream.bad() : 0; }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
const std::string& MsgStream::buffer ( ) const
inline

Access string buffer.

Definition at line 92 of file MsgStream.h.

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

Definition at line 171 of file MsgStream.h.

171  {
172  if ( isActive() ) m_stream.clear( _i );
173  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
T clear(T...args)
bool MsgStream::countInactive ( )
static

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

Definition at line 37 of file MsgStream.cpp.

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

Retrieve current stream output level.

Definition at line 105 of file MsgStream.h.

105 { return m_currLevel; }
MSG::Level m_currLevel
Current debug level.
Definition: MsgStream.h:46
void MsgStream::deactivate ( )
inline

Deactivate MsgStream.

Definition at line 109 of file MsgStream.h.

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

Output method.

Definition at line 57 of file MsgStream.cpp.

57  {
58  try {
59  // This piece of code may throw and we cannot afford it when we print a message
60  // in the middle of a catch block.
61  if ( isActive() ) {
63  if ( m_service ) {
65  } else {
66  std::cout << msg << std::endl;
67  }
68  }
69  m_stream.str( "" );
70  } catch ( ... ) {}
71  return *this;
72 }
T endl(T...args)
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
IMessageSvc * m_service
Pointer to message service if buffer has send.
Definition: MsgStream.h:34
std::string m_source
Use std::string for source information to be passed to the message service.
Definition: MsgStream.h:38
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
MSG::Level m_currLevel
Current debug level.
Definition: MsgStream.h:46
The Message class.
Definition: Message.h:17
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 31 of file MsgStream.cpp.

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

Definition at line 165 of file MsgStream.h.

165 { return isActive() ? m_stream.eof() : 0; }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
char MsgStream::fill ( ) const
inline

Definition at line 159 of file MsgStream.h.

159 { return isActive() ? m_stream.fill() : (char)-1; }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
T fill(T...args)
char MsgStream::fill ( char  v)
inline

Definition at line 160 of file MsgStream.h.

160 { return isActive() ? m_stream.fill( v ) : (char)-1; }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
T fill(T...args)
long MsgStream::flags ( ) const
inline

IOS emulation.

Definition at line 154 of file MsgStream.h.

154 { return isActive() ? m_stream.flags() : 0; }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
T flags(T...args)
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
long MsgStream::flags ( FLAG_TYPE  v)
inline

Definition at line 155 of file MsgStream.h.

155 { return isActive() ? m_stream.flags( v ) : 0; }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
T flags(T...args)
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
MsgStream& MsgStream::flush ( )
inline

Definition at line 113 of file MsgStream.h.

113  {
114  if ( isActive() ) m_stream.flush();
115  return *this;
116  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
T flush(T...args)
int MsgStream::good ( ) const
inline

Definition at line 164 of file MsgStream.h.

164 { return isActive() ? m_stream.good() : 0; }
T good(T...args)
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
bool MsgStream::isActive ( ) const
inline

Accessor: is MsgStream active.

Definition at line 111 of file MsgStream.h.

111 { return m_active; }
bool m_active
Flag set to true if formatting engine is active.
Definition: MsgStream.h:42
MSG::Level MsgStream::level ( ) const
inline

Retrieve output level.

Definition at line 103 of file MsgStream.h.

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

Accept MsgStream modifiers.

Definition at line 123 of file MsgStream.h.

123  {
124  if ( isActive() ) _f( *this );
125  return *this;
126  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
MsgStream& MsgStream::operator<< ( std::ostream &(*)(std::ostream &)  _f)
inline

Accept oMsgStream modifiers.

Definition at line 128 of file MsgStream.h.

128  {
129  if ( isActive() ) _f( m_stream );
130  return *this;
131  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
MsgStream& MsgStream::operator<< ( std::ios &(*)(std::ios &)  _f)
inline

Accept ios modifiers.

Definition at line 133 of file MsgStream.h.

133  {
134  if ( isActive() ) _f( m_stream );
135  return *this;
136  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
MsgStream& MsgStream::operator<< ( MSG::Level  level)
inline

Accept MsgStream activation using MsgStreamer operator.

Definition at line 138 of file MsgStream.h.

138 { return report( level ); }
MsgStream & report(int lvl)
Initialize report of new message: activate if print level is sufficient.
Definition: MsgStream.h:75
MSG::Level level() const
Retrieve output level.
Definition: MsgStream.h:103
MsgStream& MsgStream::operator<< ( long long  arg)
inline

Definition at line 139 of file MsgStream.h.

139  {
140  try {
141  // this may throw, and we cannot afford it if the stream is used in a catch block
142  if ( isActive() ) { m_stream << arg; }
143  } catch ( ... ) {}
144  return *this;
145  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
MsgStream& MsgStream::operator<< ( std::ios_base &(*)(std::ios_base &)  _f)
inline

Accept ios base class modifiers.

Definition at line 148 of file MsgStream.h.

148  {
149  if ( isActive() ) _f( m_stream );
150  return *this;
151  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
int MsgStream::precision ( ) const
inline

Definition at line 161 of file MsgStream.h.

161 { return isActive() ? m_stream.precision() : 0; }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
T precision(T...args)
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
int MsgStream::precision ( int  v)
inline

Definition at line 162 of file MsgStream.h.

162 { return isActive() ? m_stream.precision( v ) : 0; }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
T precision(T...args)
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
int MsgStream::rdstate ( ) const
inline

Definition at line 163 of file MsgStream.h.

163 { return isActive() ? m_stream.rdstate() : std::ios_base::failbit; }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
T rdstate(T...args)
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
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 ) ? MSG::ALWAYS : ( lvl < MSG::NIL ) ? MSG::NIL : lvl;
77  if ( ( m_currLevel = MSG::Level( lvl ) ) >= level() ) {
78  activate();
79  } else {
80  deactivate();
81 #ifndef NDEBUG
84  }
85 #endif
86  }
87  return *this;
88  }
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:38
void deactivate()
Deactivate MsgStream.
Definition: MsgStream.h:109
MSG::Level m_currLevel
Current debug level.
Definition: MsgStream.h:46
MSG::Level level() const
Retrieve output level.
Definition: MsgStream.h:103
void activate()
Activate MsgStream.
Definition: MsgStream.h:107
IInactiveMessageCounter * m_inactCounter
Pointer to service counting messages prepared but not printed because of wrong level.
Definition: MsgStream.h:51
static GAUDI_API bool countInactive()
Returns the state of the counting of inactive messages (enabled/disabled).
Definition: MsgStream.cpp:37
void MsgStream::resetColor ( )

Reset the colors to defaults.

Definition at line 99 of file MsgStream.cpp.

99  {
100 #ifndef _WIN32
101  if ( m_useColors ) {
102  try { // this may throw and we must not do it
103  m_stream << "\x1b[m" << m_service->getLogColor( m_currLevel );
104  } catch ( ... ) {}
105  }
106 #endif
107 }
bool m_useColors
use colors
Definition: MsgStream.h:48
IMessageSvc * m_service
Pointer to message service if buffer has send.
Definition: MsgStream.h:34
virtual std::string getLogColor(int logLevel) const =0
Get the color codes for various log levels.
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
MSG::Level m_currLevel
Current debug level.
Definition: MsgStream.h:46
void MsgStream::setColor ( MSG::Color  col)

Set the text color.

Definition at line 74 of file MsgStream.cpp.

74  {
75 #ifndef _WIN32
76  if ( m_useColors ) {
77  int fc = 90 + col;
78  try { // this may throw and we must not do it
79  m_stream << "\x1b[" << fc << ";1m";
80  } catch ( ... ) {}
81  }
82 #endif
83 }
bool m_useColors
use colors
Definition: MsgStream.h:48
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
void MsgStream::setColor ( MSG::Color  fg,
MSG::Color  bg 
)

Set the foreground and background colors.

Definition at line 85 of file MsgStream.cpp.

85  {
86 #ifndef _WIN32
87  if ( m_useColors ) {
88  try { // this may throw and we must not do it
89  int fc = 90 + fg;
90  m_stream << "\x1b[" << fc;
91  int bc = 100 + bg;
92  m_stream << ";" << bc;
93  m_stream << ";1m";
94  } catch ( ... ) {}
95  }
96 #endif
97 }
bool m_useColors
use colors
Definition: MsgStream.h:48
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
long MsgStream::setf ( FLAG_TYPE  v)
inline

Definition at line 156 of file MsgStream.h.

156 { return isActive() ? m_stream.setf( v ) : 0; }
T setf(T...args)
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
long MsgStream::setf ( FLAG_TYPE  _f,
FLAG_TYPE  _m 
)
inline

Definition at line 167 of file MsgStream.h.

167 { return isActive() ? m_stream.setf( _f, _m ) : 0; }
T setf(T...args)
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
void MsgStream::setLevel ( int  level)
inline

Update outputlevel.

Definition at line 98 of file MsgStream.h.

98  {
100  m_level = MSG::Level( level );
101  }
MSG::Level m_level
Debug level of the message service.
Definition: MsgStream.h:44
MSG::Level level() const
Retrieve output level.
Definition: MsgStream.h:103
void MsgStream::setMsgSvc ( IMessageSvc svc)
inline

Update IMessageSvc pointer.

Definition at line 96 of file MsgStream.h.

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

Access string MsgStream.

Definition at line 94 of file MsgStream.h.

94 { return m_stream; }
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
void MsgStream::unsetf ( FLAG_TYPE  _l)
inline

Definition at line 168 of file MsgStream.h.

168  {
169  if ( isActive() ) m_stream.unsetf( _l );
170  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
T unsetf(T...args)
int MsgStream::width ( ) const
inline

Definition at line 157 of file MsgStream.h.

157 { return isActive() ? m_stream.width() : 0; }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
T width(T...args)
int MsgStream::width ( int  v)
inline

Definition at line 158 of file MsgStream.h.

158 { return isActive() ? m_stream.width( v ) : 0; }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
T width(T...args)
MsgStream& MsgStream::write ( const char *  buff,
int  len 
)
inline

Definition at line 118 of file MsgStream.h.

118  {
119  if ( isActive() ) m_stream.write( buff, len );
120  return *this;
121  }
bool isActive() const
Accessor: is MsgStream active.
Definition: MsgStream.h:111
std::ostringstream m_stream
String MsgStream associated to buffer.
Definition: MsgStream.h:40
T write(T...args)

Member Data Documentation

bool MsgStream::m_active = false
protected

Flag set to true if formatting engine is active.

Definition at line 42 of file MsgStream.h.

std::string MsgStream::m_buffer
protected

Use standard string for information buffering.

Definition at line 36 of file MsgStream.h.

bool MsgStream::m_countInactive = false
staticprotected

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

Definition at line 53 of file MsgStream.h.

MSG::Level MsgStream::m_currLevel
protected

Current debug level.

Definition at line 46 of file MsgStream.h.

IInactiveMessageCounter* MsgStream::m_inactCounter = nullptr
protected

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

Definition at line 51 of file MsgStream.h.

MSG::Level MsgStream::m_level
protected

Debug level of the message service.

Definition at line 44 of file MsgStream.h.

IMessageSvc* MsgStream::m_service
protected

Pointer to message service if buffer has send.

Definition at line 34 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 38 of file MsgStream.h.

std::ostringstream MsgStream::m_stream
protected

String MsgStream associated to buffer.

Definition at line 40 of file MsgStream.h.

bool MsgStream::m_useColors
protected

use colors

Definition at line 48 of file MsgStream.h.


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