From 5c233380e1ebf641f6106a34d7b94f9e9a606589 Mon Sep 17 00:00:00 2001 From: Nikolai Kondrashov Date: Fri, 20 Dec 2013 16:51:37 +0200 Subject: Remove DEBUG macro support for old debug levels Remove support for specifying old debug levels to the DEBUG macro: * remove debug_get_level function which was used for conversion, * remove debug_get_level tests, * remove mentions of old/new levels from DEBUG and DEBUG_IS_SET macro descriptions, * rename "newlevel" argument of debug_fn to just "level". Reviewed-by: Jakub Hrozek Reviewed-by: Stephen Gallagher Reviewed-by: Simo Sorce --- src/util/util.h | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'src/util/util.h') diff --git a/src/util/util.h b/src/util/util.h index 9cc53f880..14d797480 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -68,9 +68,8 @@ extern int debug_timestamps; extern int debug_microseconds; extern int debug_to_file; extern const char *debug_log_file; -void debug_fn(const char *function, int newlevel, const char *format, ...) +void debug_fn(const char *function, int level, const char *format, ...) SSS_ATTRIBUTE_PRINTF(3, 4); -int debug_get_level(int old_level); int debug_convert_old_level(int old_level); errno_t set_debug_file_from_fd(const int fd); @@ -113,27 +112,18 @@ errno_t set_debug_file_from_fd(const int fd); \brief macro to generate debug messages \param level the debug level, please use one of the SSSDBG_* macros - Old format: - - 1 is for critical errors users may find it difficult to understand but - are still quite clear - - 2-4 is for stuff developers are interested in in general, but - shouldn't fill the screen with useless low level verbose stuff - - 5-6 is for errors you may want to track, but only if you explicitly - looking for additional clues - - 7-10 is for informational stuff - \param format the debug message format string, should result in a newline-terminated message \param ... the debug message format arguments */ #define DEBUG(level, format, ...) do { \ - int __debug_macro_newlevel = debug_get_level(level); \ - if (DEBUG_IS_SET(__debug_macro_newlevel)) \ - debug_fn(__FUNCTION__, __debug_macro_newlevel, format, ##__VA_ARGS__); \ + int __debug_macro_level = level; \ + if (DEBUG_IS_SET(__debug_macro_level)) \ + debug_fn(__FUNCTION__, __debug_macro_level, format, ##__VA_ARGS__); \ } while (0) /** \def DEBUG_IS_SET(level) - \brief checks whether level (must be in new format) is set in debug_level + \brief checks whether level is set in debug_level \param level the debug level, please use one of the SSSDBG*_ macros */ -- cgit