--- libelwix/inc/elwix.h 2013/01/17 10:05:35 1.1 +++ libelwix/inc/elwix.h 2013/03/07 16:24:32 1.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: elwix.h,v 1.1 2013/01/17 10:05:35 misho Exp $ +* $Id: elwix.h,v 1.2 2013/03/07 16:24:32 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -64,8 +64,9 @@ SUCH DAMAGE. #include #include #include -#include +#include #include +#include #ifndef STRSIZ @@ -147,7 +148,15 @@ extern int elwix_Verbose; #define e_incVerbose (elwix_Verbose++) #define e_decVerbose (elwix_Verbose--) -#define EVERBOSE(x) if ((x) <= elwix_Verbose) +#define EVERBS(x) if ((x) <= elwix_Verbose) +#define EVERBOSE(x, fmt, ...) do { assert((fmt)); \ + if ((x) <= elwix_Verbose) { \ + char str[BUFSIZ] = { 0 }; \ + snprintf(str, sizeof str, (fmt), ##__VA_ARGS__); \ + syslog(LOG_DEBUG, "Verbose(%d):%s(%d): %s\n", \ + (x), __func__, __LINE__, str); \ + } \ + } while (0) /* Debug macros */ extern int elwix_Debug;