diff --git a/src/common/log.c b/src/common/log.c index 2602f38342..68a3c068e0 100644 --- a/src/common/log.c +++ b/src/common/log.c @@ -264,47 +264,47 @@ _log_fn(int severity, uint32_t domain, const char *format, ...) _log_fn_function_name = NULL; } void -log_debug(uint32_t domain, const char *format, ...) +_log_debug(uint32_t domain, const char *format, ...) { va_list ap; va_start(ap,format); - logv(LOG_DEBUG, domain, NULL, format, ap); + logv(LOG_DEBUG, domain, _log_fn_function_name, format, ap); va_end(ap); _log_fn_function_name = NULL; } void -log_info(uint32_t domain, const char *format, ...) +_log_info(uint32_t domain, const char *format, ...) { va_list ap; va_start(ap,format); - logv(LOG_INFO, domain, NULL, format, ap); + logv(LOG_INFO, domain, _log_fn_function_name, format, ap); va_end(ap); _log_fn_function_name = NULL; } void -log_notice(uint32_t domain, const char *format, ...) +_log_notice(uint32_t domain, const char *format, ...) { va_list ap; va_start(ap,format); - logv(LOG_NOTICE, domain, NULL, format, ap); + logv(LOG_NOTICE, domain, _log_fn_function_name, format, ap); va_end(ap); _log_fn_function_name = NULL; } void -log_warn(uint32_t domain, const char *format, ...) +_log_warn(uint32_t domain, const char *format, ...) { va_list ap; va_start(ap,format); - logv(LOG_WARN, domain, NULL, format, ap); + logv(LOG_WARN, domain, _log_fn_function_name, format, ap); va_end(ap); _log_fn_function_name = NULL; } void -log_err(uint32_t domain, const char *format, ...) +_log_err(uint32_t domain, const char *format, ...) { va_list ap; va_start(ap,format); - logv(LOG_ERR, domain, NULL, format, ap); + logv(LOG_ERR, domain, _log_fn_function_name, format, ap); va_end(ap); _log_fn_function_name = NULL; } diff --git a/src/common/log.h b/src/common/log.h index e3f90f600b..cf2f727f5f 100644 --- a/src/common/log.h +++ b/src/common/log.h @@ -142,15 +142,20 @@ void _log_fn(int severity, uint32_t domain, #else /* ! defined(__GNUC__) */ void _log_fn(int severity, uint32_t domain, const char *format, ...); -void log_debug(uint32_t domain, const char *format, ...); -void log_info(uint32_t domain, const char *format, ...); -void log_notice(uint32_t domain, const char *format, ...); -void log_warn(uint32_t domain, const char *format, ...); -void log_err(uint32_t domain, const char *format, ...); +void _log_debug(uint32_t domain, const char *format, ...); +void _log_info(uint32_t domain, const char *format, ...); +void _log_notice(uint32_t domain, const char *format, ...); +void _log_warn(uint32_t domain, const char *format, ...); +void _log_err(uint32_t domain, const char *format, ...); #if defined(_MSC_VER) && _MSC_VER < 1300 /* MSVC 6 and earlier don't have __FUNCTION__, or even __LINE__. */ #define log_fn _log_fn +#define log_debug _log_debug +#define log_info _log_info +#define log_notice _log_notice +#define log_warn _log_warn +#define log_err _log_err /* #define debug _debug #define info _info @@ -166,6 +171,11 @@ extern const char *_log_fn_function_name; * do {...} while (0) trick to wrap this macro, since the macro can't take * arguments. */ #define log_fn (_log_fn_function_name=__FUNCTION__),_log_fn +#define log_debug (_log_fn_function_name=__FUNCTION__),_log_debug +#define log_info (_log_fn_function_name=__FUNCTION__),_log_info +#define log_notice (_log_fn_function_name=__FUNCTION__),_log_notice +#define log_warn (_log_fn_function_name=__FUNCTION__),_log_warn +#define log_err (_log_fn_function_name=__FUNCTION__),_log_err /* #define debug (_log_fn_function_name=__FUNCTION__),_debug #define info (_log_fn_function_name=__FUNCTION__),_info