00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef _y2log_ycp_h
00013 #define _y2log_ycp_h
00014
00015 #include <y2util/y2log.h>
00016 #include "ExecutionEnvironment.h"
00017
00018
00019
00020 #define y2scanner(file,line,format,args...) \
00021 y2_logger(LOG_ERROR,"Scanner",file,line,"",format,##args)
00022 #define syn2error(file,line,format,args...) \
00023 y2_logger(LOG_ERROR,"Parser",file,line,"",format,##args)
00024 #define sem2error(file,line,format,args...) \
00025 y2_logger(LOG_ERROR,"Runtime",file,line,"",format,##args)
00026
00027 #define ycp2log(level,file,line,func,format,args...) \
00028 y2_logger(level,"YCP",file,line,func,format,##args)
00029
00030 #define y2ycp(level,file,line,format,args...) \
00031 y2_logger(level,"Interpreter",file,line,"",format,##args)
00032
00033 #define ycp2debug(file,line,format,args...) \
00034 y2ycp(LOG_DEBUG,file,line,format,##args)
00035 #define ycp2milestone(file,line,format,args...) \
00036 y2ycp(LOG_MILESTONE,file,line,format,##args)
00037 #define ycp2warning(file,line,format,args...) \
00038 y2ycp(LOG_WARNING,file,line,format,##args)
00039 #define ycp2error(format,args...) \
00040 do { \
00041 extern ExecutionEnvironment ee; \
00042 y2ycp(LOG_ERROR, ee.filename().c_str(), ee.linenumber(), format, ##args); \
00043 } while (0)
00044 #define ycp2error(format,args...) \
00045 do { \
00046 extern ExecutionEnvironment ee; \
00047 y2ycp(LOG_ERROR, ee.filename().c_str(), ee.linenumber(), format, ##args); \
00048 } while (0)
00049 #define ycp2security(file,line,format,args...) \
00050 y2ycp(LOG_SECURITY,file,line,format,##args)
00051 #define ycp2internal(file,line,format,args...) \
00052 y2ycp(LOG_INTERNAL,file,line,format,##args)
00053
00054
00055 #define ycp_log(level,format,args...) \
00056 do { \
00057 extern ExecutionEnvironment ee; \
00058 y2_logger(level, Y2LOG, ee.filename().c_str(), ee.linenumber(), "", format, ##args); \
00059 } while (0)
00060
00061
00062 #define ycperror(format,args...) \
00063 ycp_log(LOG_ERROR, format, ##args)
00064
00065 #define ycpwarning(format,args...) \
00066 ycp_log(LOG_WARNING, format, ##args)
00067
00068 #define ycpdebug(format,args...) \
00069 ycp_log(LOG_DEBUG, format, ##args)
00070
00071 #define ycpinternal(format,args...) \
00072 ycp_log(LOG_INTERNAL, format, ##args)
00073
00074 #define ycpmilestone(format,args...) \
00075 ycp_log(LOG_MILESTONE, format, ##args)
00076
00077 #endif