1,宏定义:
#include <stdio.h>
#include <stdarg.h>
#define BUFFER_SIZE 1024
#define DEBUG_LEVEL 4
typedef enum{
DEBUG_LEVEL_ERROR=0,
DEBUG_LEVEL_WARNING,
DEBUG_LEVEL_NOTICE,
DEBUG_LEVEL_INFO,
DEBUG_LEVEL_DEBUG
}ErrorLevel;
#define transDebug(level) \
do{ \
switch(level) \
{ \
case 0: \
printf("Error: "); \
break; \
case 1: \
printf("Warning: "); \
break; \
case 2: \
printf("Notice: "); \
break; \
case 3: