Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | Related Pages

streamlog.h

00001 // -*- mode: c++;
00002 #ifndef streamlog_h
00003 #define streamlog_h
00004 
00015 #ifndef DONT_USE_STREAMLOG
00016 #define USE_STREAMLOG 
00017 #endif
00018 
00019 #ifdef  USE_STREAMLOG
00020 
00021 #include "logstream.h"
00022 #include "logscope.h"
00023 #include "loglevels.h"
00024 
00025 
00026 #define  streamlog_out( MLEVEL ) if(streamlog::out.write< streamlog::MLEVEL >() ) streamlog::out()  
00027 
00028 
00029 #define  streamlog_message( MLEVEL , CODE_BLOCK , OUT_MESSAGE)\
00030    if( streamlog::out.write< streamlog::MLEVEL >() ) { \
00031       CODE_BLOCK \
00032     streamlog::out() << OUT_MESSAGE }
00033 
00034 //for use in templated classes with gcc 3.2 use these macros:
00035 #define  streamlog_out_T( MLEVEL ) if(streamlog::out.template write< streamlog::MLEVEL >() ) streamlog::out() 
00036 
00037 #define  streamlog_message_T( MLEVEL , CODE_BLOCK , OUT_MESSAGE)\
00038    if( streamlog::out.template write< streamlog::MLEVEL >() ) { \
00039       CODE_BLOCK \
00040     streamlog::out() << OUT_MESSAGE }
00041 
00042 #else
00043 
00044 #define  streamlog_out( MLEVEL ) std::cout
00045 
00046 #define  streamlog_message( MLEVEL , CODE_BLOCK , OUT_MESSAGE)\
00047    if( true ) { \
00048       CODE_BLOCK \
00049       std::out << OUT_MESSAGE }
00050 
00051 #endif
00052 
00053 
00054 #endif

Generated on Mon Jan 12 09:48:51 2009 for Marlin by doxygen 1.3.5