From 2673568cfdb4f10f5292398e08cb9894810ea0b5 Mon Sep 17 00:00:00 2001 From: davidhaas Date: Mon, 17 Mar 2003 16:59:22 +0000 Subject: [PATCH] Added default settings for DBG_MIN_LEVEL and definitions for the possible levels. --- src/include/lwip/debug.h | 11 ++++++++--- src/include/lwip/opt.h | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/include/lwip/debug.h b/src/include/lwip/debug.h index bb8d9ad5..dc1838a3 100644 --- a/src/include/lwip/debug.h +++ b/src/include/lwip/debug.h @@ -40,7 +40,12 @@ * - 2 serious * - 3 severe */ -#define DBG_MASK_LEVEL 3 + +#define DBG_LEVEL_OFF 0 +#define DBG_LEVEL_WARNING 1 +#define DBG_LEVEL_SERIOUS 2 +#define DBG_LEVEL_SEVERE 3 +#define DBG_MASK_LEVEL 3 /** flag for DEBUGF to enable the debug message */ #define DBG_ON 0x80U @@ -62,12 +67,12 @@ /** print debug message only if debug message is enabled AND is of correct type * AND is at least DBG_LEVEL */ #define DEBUGF(debug, x) do { if ((debug & DBG_ON) && (debug & DBG_TYPES_ON) && ((debug & DBG_MASK_LEVEL) >= DBG_MIN_LEVEL)) { LWIP_PLATFORM_DIAG(x); if (debug & DBG_HALT) while(1); } } while(0) -#define LWIP_ERROR(x) do { LWIP_PLATFORM_DIAG(x); } while(0) +#define LWIP_ERROR(x) do { LWIP_PLATFORM_DIAG(x); } while(0) #else /* LWIP_DEBUG */ #define LWIP_ASSERT(x,y) #define DEBUGF(debug, x) -#define LWIP_ERROR(x) +#define LWIP_ERROR(x) #endif /* LWIP_DEBUG */ diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index fa9baaf8..391e6b6e 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -430,6 +430,10 @@ a lot of data that needs to be copied, this should be set high. */ #endif +#ifndef DBG_MIN_LEVEL +#define DBG_MIN_LEVEL DBG_LEVEL_OFF +#endif + #endif /* __LWIP_OPT_H__ */