|
yast2-core
|
00001 /* Y2Logger.h 00002 * 00003 * Macros for logging the output. 00004 * 00005 * Just #include "Y2Logger.h" and use Y2_DEBUG, Y2_WARNING or Y2_ERROR 00006 * 00007 * If you write Y2_DEBUG("Hello: %d",7) on line 13 in the file Source.cc, 00008 * the debug output will look like this: 00009 * [...]:Source.cc[13] Hello: 7 00010 * 00011 * Additionally you can #define Y2_COMPONENT before inclusion and its name 00012 * will be put just before the Source.cc. 00013 * And don't forget set (end export the Y2DEBUG shell variable! 00014 * 00015 * Also define Y2_DEBUG_YES if you want to get the debugging output! 00016 * 00017 * Author: Michal Svec <msvec@suse.cz> 00018 * Daniel Vesely <dan@suse.cz> 00019 * 00020 * $Id: Y2Logger.h 13249 2004-01-17 13:56:49Z msvec $ 00021 */ 00022 00023 #ifndef Y2Logger_h 00024 #define Y2Logger_h 00025 00026 #include <ycp/y2log.h> 00027 00028 /* 00029 * Log the error and return ... 00030 */ 00031 #define Y2_RETURN_FALSE(format,args...) \ 00032 do { ycp2error(format,##args); return false; } while(0) 00033 00034 #define Y2_RETURN_VOID(format,args...) \ 00035 do { ycp2error(format,##args); return YCPNull(); } while(0) 00036 00037 #define Y2_RETURN_STR(format,args...) \ 00038 do { ycp2error(format,##args); return ""; } while(0) 00039 00040 #define Y2_RETURN_YCP_FALSE(format,args...) \ 00041 do { ycp2error(format,##args); return YCPBoolean(false); } while(0) 00042 00043 #endif /* Y2Logger_h */
1.7.3