#include <GaudiMessages.h>
Collaboration diagram for GaudiMsgStreams:
Public Member Functions | |
GaudiMsgStreams (const std::string &streamName="") | |
MsgStream & | log (MSG::Level level) |
MsgStream & | verbose () |
MsgStream & | debug () |
MsgStream & | info () |
MsgStream & | warning () |
MsgStream & | error () |
MsgStream & | fatal () |
MsgStream & | always () |
Private Member Functions | |
GaudiMsgStreams & | operator= (const GaudiMsgStreams &) |
Private Attributes | |
MsgStream | m_msgStream |
Use like:
void my_function() { // a useful label would be the function/method name GaudiMsgStreams log("Some useful label");
log.error() << "Uh oh!" << endreq; log.warning() << "Oh My!" << endreq; log.info() << "Blah blah" << endreq; log.debug() << "Boooring" << endreq; log.verbose() << "Shut up!" << endreq;
// needs include "GaudiKernel/IMessageSvc.h" to define levels int level = MSG::INFO; log.log(level) << "Specify the level" << endreq; }
Definition at line 43 of file GaudiMessages.h.
GaudiMsgStreams::GaudiMsgStreams | ( | const std::string & | streamName = "" |
) |
Definition at line 15 of file GaudiMessages.cc.
00016 : m_msgStream(msgSvc(),streamName) 00017 { 00018 00019 }
GaudiMsgStreams& GaudiMsgStreams::operator= | ( | const GaudiMsgStreams & | ) | [private] |
MsgStream & GaudiMsgStreams::log | ( | MSG::Level | level | ) |
Definition at line 21 of file GaudiMessages.cc.
00022 { 00023 m_msgStream << level; 00024 return m_msgStream; 00025 }
MsgStream & GaudiMsgStreams::verbose | ( | ) |
Definition at line 27 of file GaudiMessages.cc.
00028 { 00029 return this->log(MSG::VERBOSE); 00030 }
MsgStream & GaudiMsgStreams::debug | ( | ) |
MsgStream & GaudiMsgStreams::info | ( | ) |
MsgStream & GaudiMsgStreams::warning | ( | ) |
Definition at line 39 of file GaudiMessages.cc.
00040 { 00041 return this->log(MSG::WARNING); 00042 }
MsgStream & GaudiMsgStreams::error | ( | ) |
MsgStream & GaudiMsgStreams::fatal | ( | ) |
MsgStream & GaudiMsgStreams::always | ( | ) |
MsgStream GaudiMsgStreams::m_msgStream [private] |
Definition at line 45 of file GaudiMessages.h.