00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef Y2SLog_h
00020 #define Y2SLog_h
00021
00022 #include <iostream>
00023
00024
00025
00026
00027 #ifndef Y2LOG
00028 #define Y2LOG "DEFINE_Y2LOG"
00029 #endif
00030
00031 #include <y2util/y2log.h>
00032
00034
00035 namespace Y2SLog {
00036
00038
00039 extern bool dbg_enabled_bm;
00040
00041 extern std::ostream & get( const char * which, const unsigned level,
00042 const char * fil, const char * fnc, const int lne );
00043
00044 extern std::ostream & getdbg( const char * which, const unsigned level,
00045 const char * fil, const char * fnc, const int lne );
00046
00047 }
00049
00050 #define _Y2SLOG(c,l) Y2SLog::get( c, l, __FILE__, __FUNCTION__, __LINE__ )
00051 #define _Y2SLOD(c,l) Y2SLog::get( c"++", 1, __FILE__, __FUNCTION__, __LINE__ )
00052 #define _Y2SLOGDBG(c,l) Y2SLog::getdbg( c"-dbg", l, __FILE__, __FUNCTION__, __LINE__ )
00053 #define _Y2SLODDBG(c,l) Y2SLog::getdbg( c"-dbg++", 1, __FILE__, __FUNCTION__, __LINE__ )
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 #define _DBG(c) _Y2SLOD( c, 0 )
00065 #define _MIL(c) _Y2SLOG( c, 1 )
00066 #define _WAR(c) _Y2SLOG( c, 2 )
00067 #define _ERR(c) _Y2SLOG( c, 3 )
00068 #define _SEC(c) _Y2SLOG( c, 4 )
00069 #define _INT(c) _Y2SLOG( c, 5 )
00070
00071 #define DBG _DBG(Y2LOG)
00072 #define MIL _MIL(Y2LOG)
00073 #define WAR _WAR(Y2LOG)
00074 #define ERR _ERR(Y2LOG)
00075 #define SEC _SEC(Y2LOG)
00076 #define INT _INT(Y2LOG)
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088 #define _D__(c) _Y2SLODDBG( c, 0 )
00089 #define _M__(c) _Y2SLOGDBG( c, 1 )
00090 #define _W__(c) _Y2SLOGDBG( c, 2 )
00091 #define _E__(c) _Y2SLOGDBG( c, 3 )
00092 #define _S__(c) _Y2SLOGDBG( c, 4 )
00093 #define _I__(c) _Y2SLOGDBG( c, 5 )
00094
00095 #define D__ _D__(Y2LOG)
00096 #define M__ _M__(Y2LOG)
00097 #define W__ _W__(Y2LOG)
00098 #define E__ _E__(Y2LOG)
00099 #define S__ _S__(Y2LOG)
00100 #define I__ _I__(Y2LOG)
00101
00103
00104 #endif // Y2SLog_h