1 #ifndef GAUDIKERNEL_MSGSTREAM_H 2 #define GAUDIKERNEL_MSGSTREAM_H 63 : m_service( msg.m_service )
64 , m_active( msg.m_active )
65 , m_level( msg.m_level )
66 , m_currLevel( msg.m_currLevel )
67 , m_useColors( msg.m_useColors )
68 , m_inactCounter( msg.m_inactCounter )
182 long setf( FLAG_TYPE _f, FLAG_TYPE _m ) {
return isActive() ? m_stream.
setf( _f, _m ) : 0; }
187 void clear( STATE_TYPE _i = std::ios_base::failbit )
216 inline MsgStream& operator<<( MsgStream& s, const std::_Fillobj<_E>& obj )
219 if (
s.isActive() )
s.stream().fill( obj._Fill );
221 if (
s.isActive() )
s.stream().fill( obj._Ch );
226 inline MsgStream& operator<<( MsgStream& s, const std::_Smanip<_Tm>& manip )
229 if (
s.isActive() ) ( *manip._Pfun )(
s.stream(), manip._Manarg );
231 if (
s.isActive() ) ( *manip._Pf )(
s.stream(), manip._Manarg );
235 #elif defined( __GNUC__ ) 282 #endif // not __APPLE__ 283 #else // GCC, version << 3 286 inline MsgStream& operator<<( MsgStream& s, const std::smanip<_Tm>& manip )
295 #endif // WIN32 or (__GNUC__) 324 template <
typename T>
336 #if defined( __GNUC__ ) and not defined( __APPLE__ ) 337 template <
typename T>
339 MsgStream& operator<<( MsgStream& lhs, const std::_Setfill<T>& manip )
341 if ( lhs.isActive() )
try {
350 #endif // GAUDIKERNEL_MSGSTREAM_H std::ostringstream & stream()
Access string MsgStream.
Definition of the MsgStream class used to transmit messages.
MsgStream & operator<<(longlong arg)
const std::string & buffer() const
Access string buffer.
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
bool m_useColors
use colors
GAUDI_API void resetColor()
Reset the colors to defaults.
static bool m_countInactive
Flag to state if the inactive messages has to be counted.
MsgStream & dec(MsgStream &log)
bool isActive() const
Accessor: is MsgStream active.
IMessageSvc * m_service
Pointer to message service if buffer has send.
MsgStream & write(const char *buff, int len)
virtual void incrInactiveCount(MSG::Level level, const std::string &src)=0
Increment deactivated message count.
MsgStream & report(int lvl)
Initialize report of new message: activate if print level is sufficient.
MsgStream & hex(MsgStream &log)
virtual GAUDI_API MsgStream & doOutput()
Output method.
std::string m_source
Use std::string for source information to be passed to the message service.
Provide serialization function (output only) for some common STL classes (vectors, lists, pairs, maps) plus GaudiUtils::Map and GaudiUtils::HashMap.
MSG::Level m_level
Debug level of the message service.
GAUDI_API void setColor(MSG::Color col)
Set the text color.
std::ios_base::iostate STATE_TYPE
MsgStream & operator<<(MsgStream &(*_f)(MsgStream &))
Accept MsgStream modifiers.
MsgStream & operator<<(std::ios_base &(*_f)(std::ios_base &))
Accept ios base class modifiers.
long setf(FLAG_TYPE _f, FLAG_TYPE _m)
MsgStream & operator<<(std::ios &(*_f)(std::ios &))
Accept ios modifiers.
MSG::Level currentLevel() const
Retrieve current stream output level.
void clear(STATE_TYPE _i=std::ios_base::failbit)
void deactivate()
Deactivate MsgStream.
std::ostringstream m_stream
String MsgStream associated to buffer.
The IMessage is the interface implemented by the message service.
MsgStream & operator<<(MSG::Level level)
Accept MsgStream activation using MsgStreamer operator.
void setMsgSvc(IMessageSvc *svc)
Update IMessageSvc pointer.
bool m_active
Flag set to true if formatting engine is active.
std::string m_buffer
Use standard string for information buffering.
MSG::Level m_currLevel
Current debug level.
GAUDI_API MsgStream(IMessageSvc *svc, int buffer_length=128)
Standard constructor: Connect to message service for output.
long flags() const
IOS emulation.
Print levels enumeration.
Forward declarations for the functions in SerializeSTL.h.
void setLevel(int level)
Update outputlevel.
MsgStream & operator<<(std::ostream &(*_f)(std::ostream &))
Accept oMsgStream modifiers.
MSG::Level level() const
Retrieve output level.
void activate()
Activate MsgStream.
MsgStream(const MsgStream &msg)
Copy constructor.
IInactiveMessageCounter * m_inactCounter
Pointer to service counting messages prepared but not printed because of wrong level.
std::ios_base::fmtflags FLAG_TYPE
Error return code in case ios modification is requested for inactive streams.
static GAUDI_API bool enableCountInactive(bool value=true)
Enable/disable the count of inactive messages.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
virtual GAUDI_API ~MsgStream()=default
Standard destructor.
static GAUDI_API bool countInactive()
Returns the state of the counting of inactive messages (enabled/disabled).
void unsetf(FLAG_TYPE _l)