From b52ed49d75ff77ef4f6ad2bef576184bda9b98d0 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Sun, 28 Sep 2014 17:45:35 -0400 Subject: Revert "Remove log_cb, add ALPM_EVENT_LOG instead" Moving logging to the event callback caused warnings under clang due to non-literal format strings and silenced all log messages when --print was used. This reverts commit cd793c5ab7689cc8cbc18277375b368060e5acfe. Signed-off-by: Andrew Gregory Conflicts: lib/libalpm/alpm.h src/pacman/callback.c Signed-off-by: Allan McRae --- lib/libalpm/log.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'lib/libalpm/log.c') diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c index aac55e70..d232bcc3 100644 --- a/lib/libalpm/log.c +++ b/lib/libalpm/log.c @@ -81,19 +81,15 @@ int SYMEXPORT alpm_logaction(alpm_handle_t *handle, const char *prefix, void _alpm_log(alpm_handle_t *handle, alpm_loglevel_t flag, const char *fmt, ...) { - alpm_event_log_t event = { - .type = ALPM_EVENT_LOG, - .level = flag, - .fmt = fmt - }; + va_list args; - if(handle == NULL || handle->eventcb == NULL) { + if(handle == NULL || handle->logcb == NULL) { return; } - va_start(event.args, fmt); - EVENT(handle, &event); - va_end(event.args); + va_start(args, fmt); + handle->logcb(flag, fmt, args); + va_end(args); } /* vim: set noet: */ -- cgit v1.2.3-24-g4f1b