00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef Y2Logger_h
00024 #define Y2Logger_h
00025
00026 #define y2log_component "ag_ppd"
00027 #include <ycp/y2log.h>
00028
00029
00030 #define Y2_DEBUG_YES 1
00031
00032 extern char last_error[1024];
00033
00034
00035
00036
00037 #ifndef Y2_DEBUG_YES
00038 #define Y2_DEBUG(format,args...)
00039 #else
00040 #define Y2_DEBUG(format,args...) \
00041 y2debug(format,##args)
00042 #endif
00043
00044 #define Y2_WARNING(format,args...) \
00045 y2warning(format,##args)
00046
00047 #define Y2_ERROR(format,args...) \
00048 {\
00049 y2error(format,##args);\
00050 snprintf (last_error,1023,format,##args);\
00051 }
00052
00053
00054
00055
00056 #define Y2_RETURN_FALSE(format,args...) \
00057 { y2error(format,##args); return false; }
00058
00059 #define Y2_RETURN_VOID(format,args...) \
00060 { y2error(format,##args); return YCPVoid(); }
00061
00062 #define Y2_RETURN_STR(format,args...) \
00063 { y2error(format,##args); return ""; }
00064
00065 #define Y2_RETURN_YCP_FALSE(format,args...) \
00066 { y2error(format,##args); return YCPBoolean(false); }
00067
00068 #endif