diff --git a/debug.h b/debug.h index c0743e0..43a445b 100644 --- a/debug.h +++ b/debug.h @@ -22,11 +22,16 @@ /** @file debug.h @brief Debug output routines @author Copyright (C) 2004 Philippe April + @author Copyright (C) 2016 Dengfeng Liu */ #ifndef _WIFIDOG_DEBUG_H_ #define _WIFIDOG_DEBUG_H_ +#include + +#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) + typedef struct _debug_conf { int debuglevel; /**< @brief Debug information verbosity */ int log_stderr; /**< @brief Output log to stdout */ @@ -41,7 +46,7 @@ extern debugconf_t debugconf; * @param level Debug level * @param format... sprintf like format string */ -#define debug(level, format...) _debug(__FILE__, __LINE__, level, format) +#define debug(level, format...) _debug(__FILENAME__, __LINE__, level, format) /** @internal */ void _debug(const char *, int, int, const char *, ...);