1 #ifndef GAUDIKERNEL_MSGSTREAM_H 2 #define GAUDIKERNEL_MSGSTREAM_H 61 : m_service(msg.m_service),
62 m_active(msg.m_active),
64 m_currLevel(msg.m_currLevel),
65 m_useColors(msg.m_useColors),
66 m_inactCounter(msg.m_inactCounter)
216 long setf(FLAG_TYPE _f, FLAG_TYPE _m) {
222 void clear(STATE_TYPE _i = std::ios_base::failbit) {
252 template<
class _E>
inline 253 MsgStream& operator<<( MsgStream& s, const std::_Fillobj<_E>& obj) {
255 if (
s.isActive() )
s.stream().fill(obj._Fill);
257 if (
s.isActive() )
s.stream().fill(obj._Ch);
261 template<
class _Tm>
inline 262 MsgStream& operator << (MsgStream& s, const std::_Smanip<_Tm>& manip) {
264 if (
s.isActive() ) (*manip._Pfun)(
s.stream(), manip._Manarg);
266 if (
s.isActive() ) (*manip._Pf)(
s.stream(), manip._Manarg);
270 #elif defined (__GNUC__) 273 const std::_Setiosflags &manip) {
281 const std::_Resetiosflags &manip) {
289 const std::_Setbase &manip) {
297 const std::_Setprecision &manip) {
305 const std::_Setw &manip) {
312 #endif // not __APPLE__ 313 #else // GCC, version << 3 314 template<
class _Tm>
inline 316 MsgStream& operator << (MsgStream& s, const std::smanip<_Tm>& manip) {
323 #endif // WIN32 or (__GNUC__) 349 template <
typename T>
361 #if defined(__GNUC__) and not defined(__APPLE__) 364 MsgStream& operator << (MsgStream& lhs, const std::_Setfill<T> &manip) {
365 if ( lhs.isActive() )
374 #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.
MSG::Level currentLevel()
Retrieve current stream output level.
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.
MSG::Level level()
Retrieve output level.
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.
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.
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.
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)