From 4d5ea9b073c2cd77d6c833935a9f35f23aba83e7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 13 Jan 2007 18:29:50 +0000 Subject: Add function for to toggle debug setting --- common/logging.c | 9 +++++++-- common/logging.h | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/common/logging.c b/common/logging.c index 22cbd7e0..123dd809 100644 --- a/common/logging.c +++ b/common/logging.c @@ -67,12 +67,17 @@ void debug(const char *format, ...) va_end(ap); } -void enable_debug() +void toggle_debug(void) +{ + debug_enabled %= 1; +} + +void enable_debug(void) { debug_enabled = 1; } -void disable_debug() +void disable_debug(void) { debug_enabled = 0; } diff --git a/common/logging.h b/common/logging.h index 92bbd064..9ccc349d 100644 --- a/common/logging.h +++ b/common/logging.h @@ -27,8 +27,9 @@ void info(const char *format, ...); void error(const char *format, ...); void debug(const char *format, ...); -void enable_debug(); -void disable_debug(); +void toggle_debug(void); +void enable_debug(void); +void disable_debug(void); void start_logging(const char *ident, const char *message); void stop_logging(void); -- cgit