00001
00002
00003 #ifndef ASGTOOLS_MSGSTREAMMACROS_H
00004 #define ASGTOOLS_MSGSTREAMMACROS_H
00005
00006
00007 #include "AsgTools/AsgToolsConf.h"
00008 #include "AsgTools/MsgLevel.h"
00009
00010
00011 #ifdef ASGTOOL_ATHENA
00012 # include "AthenaBaseComps/AthMsgStreamMacros.h"
00013 #elif defined(ASGTOOL_STANDALONE)
00014
00015
00016 #undef ERROR
00017
00018
00019 #if defined( __GNUC__ )
00020 # define MSGSTREAM_FNAME __PRETTY_FUNCTION__
00021 #else
00022 # define MSGSTREAM_FNAME ""
00023 #endif
00024
00032 #define MSGSTREAM_REPORT_PREFIX \
00033 __FILE__ << ":" << __LINE__ << " (" << MSGSTREAM_FNAME << "): "
00034
00036 #define ATH_MSG_LVL_SERIOUS( lvl, xmsg ) \
00037 msg( lvl ) << MSGSTREAM_REPORT_PREFIX << xmsg << endmsg
00038
00040 #define ATH_MSG_LVL_NOCHK( lvl, xmsg ) \
00041 msg( lvl ) << xmsg << endmsg
00042
00044 #define ATH_MSG_LVL( lvl, xmsg ) \
00045 do { \
00046 if( msg().msgLevel( lvl ) ) { \
00047 ATH_MSG_LVL_NOCHK( lvl, xmsg ); \
00048 } \
00049 } while( 0 )
00050
00052 #define ATH_MSG_VERBOSE( xmsg ) ATH_MSG_LVL( MSG::VERBOSE, xmsg )
00054 #define ATH_MSG_DEBUG( xmsg ) ATH_MSG_LVL( MSG::DEBUG, xmsg )
00056 #define ATH_MSG_INFO( xmsg ) ATH_MSG_LVL_NOCHK( MSG::INFO, xmsg )
00058 #define ATH_MSG_WARNING( xmsg ) ATH_MSG_LVL_NOCHK( MSG::WARNING, xmsg )
00060 #define ATH_MSG_ERROR( xmsg ) ATH_MSG_LVL_SERIOUS( MSG::ERROR, xmsg )
00062 #define ATH_MSG_FATAL( xmsg ) ATH_MSG_LVL_SERIOUS( MSG::FATAL, xmsg )
00064 #define ATH_MSG_ALWAYS( xmsg ) ATH_MSG_LVL_NOCHK( MSG::ALWAYS, xmsg )
00065
00066 #else
00067 # error "What environment are we in?!?"
00068 #endif // Environment selection
00069 #endif // ASGTOOLS_MSGSTREAMMACROS_H