X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Futils_debug.h;h=63567d315fd1118c7a6334a3b558c2d0a319b68c;hb=98da2aa3ade7446863800c2f219d8a53fb2fbf6f;hp=247b141d641955757d7a70ad9175273b3450432d;hpb=552510b091ac19691b8ebe0ffc5bc7c0ca74ac19;p=collectd.git diff --git a/src/utils_debug.h b/src/utils_debug.h index 247b141d..63567d31 100644 --- a/src/utils_debug.h +++ b/src/utils_debug.h @@ -1,6 +1,6 @@ /** * collectd - src/utils_debug.h - * Copyright (C) 2005 Niki W. Waibel + * Copyright (C) 2005,2006 Niki W. Waibel * * This program is free software; you can redistribute it and/ * or modify it under the terms of the GNU General Public Li- @@ -21,14 +21,19 @@ * Niki W. Waibel **/ +/* BUG: at the moment you can use DBG_STARTFILE only ONCE in + your program. more then one logfile is not supported. */ + #if !COLLECTD_UTILS_DEBUG_H #define COLLECTD_UTILS_DEBUG_H 1 +#if COLLECT_DEBUG + #define DBG(...) cu_debug(__FILE__, __LINE__, __func__, \ __VA_ARGS__) -#define DBG_STARTFILE(...) cu_debug_startfile(__FILE__, __LINE__, \ - __func__, __VA_ARGS__) +#define DBG_STARTFILE(file, ...) cu_debug_startfile(__FILE__, __LINE__, \ + __func__, file, __VA_ARGS__) #define DBG_STOPFILE(...) cu_debug_stopfile(__FILE__, __LINE__, \ __func__, __VA_ARGS__) @@ -39,12 +44,21 @@ void cu_debug(const char *file, int line, const char *func, const char *format, ...); int cu_debug_startfile(const char *file, int line, const char *func, - const char *format, ...); + const char *filename, const char *format, ...); int cu_debug_stopfile(const char *file, int line, const char *func, const char *format, ...); int cu_debug_resetfile(const char *file, int line, const char *func, const char *filename); +#else /* !COLLECT_DEBUG */ + +#define DBG(...) /* DBG(...) */ +#define DBG_STARTFILE(file, ...) /* DBG_STARTFILE(file, ...) */ +#define DBG_STOPFILE(...) /* DBG_STOPFILE(...) */ +#define DBG_RESETFILE(file) /* DBG_RESETFILE(file) */ + +#endif /* COLLECT_DEBUG */ + #endif /* !COLLECTD_UTILS_DEBUG_H */