diff options
-rw-r--r-- | src/log.c | 25 | ||||
-rw-r--r-- | src/log.h | 16 |
2 files changed, 7 insertions, 34 deletions
@@ -20,36 +20,25 @@ #include <stdio.h> #include <isc/formatcheck.h> +#include <isc/util.h> #include <dns/log.h> #include "log.h" -#define MSG_BUFFER_SIZE 2048 - -/* - * TODO: - * - Some compiler format checks would be nice. - * - Think about log_unexpected_file_line(), maybe use something else. - */ - - void log_debug(int level, const char *format, ...) { va_list args; va_start(args, format); +#ifndef LOG_AS_ERROR + UNUSED(level); isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DYNDB, - ISC_LOG_DEBUG(level), format, args); -#if 0 - /* - * For now, behave same as log_error(), so we can see every debugging - * logs without the need to specify -d. - */ + ISC_LOG_ERROR, format, args); +#else isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DYNDB, - ISC_LOG_ERROR, format, args); - (void)level; + ISC_LOG_DEBUG(level), format, args); #endif va_end(args); @@ -62,7 +51,7 @@ log_error(const char *format, ...) va_start(args, format); isc_log_vwrite(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DYNDB, - ISC_LOG_ERROR, format, args); + ISC_LOG_ERROR, format, args); va_end(args); } @@ -25,22 +25,6 @@ #define fatal_error(...) \ isc_error_fatal(__FILE__, __LINE__, __VA_ARGS__) -/* - * Change these to use our string library. - */ - -#define log_func(logstr) log_debug(2, "%s: %s", __func__, (logstr)) -#define log_func_va(logstr, ...) \ - log_debug(2, "%s: " logstr, __func__, __VA_ARGS__) - -#define log_func_enter() log_func("entering") -#define log_func_enter_args(logstr, ...) \ - log_func_va("entering, args: " logstr, __VA_ARGS__) - -#define log_func_exit() log_func("exiting") -#define log_func_exit_result(res) \ - log_func_va("exiting with %s", isc_result_totext(res)) - /* Basic logging functions */ void log_debug(int level, const char *format, ...) ISC_FORMAT_PRINTF(2, 3); void log_error(const char *format, ...) ISC_FORMAT_PRINTF(1, 2); |