From cd793c5ab7689cc8cbc18277375b368060e5acfe Mon Sep 17 00:00:00 2001 From: Olivier Brunel Date: Fri, 10 Jan 2014 16:25:15 +0100 Subject: Remove log_cb, add ALPM_EVENT_LOG instead When ALPM emits a log message, it still goes through _alpm_log() but instead of calling a specific log callback, it goes as an event. Signed-off-by: Olivier Brunel Signed-off-by: Allan McRae --- lib/libalpm/log.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lib/libalpm/log.c') diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c index d232bcc3..aac55e70 100644 --- a/lib/libalpm/log.c +++ b/lib/libalpm/log.c @@ -81,15 +81,19 @@ 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, ...) { - va_list args; + alpm_event_log_t event = { + .type = ALPM_EVENT_LOG, + .level = flag, + .fmt = fmt + }; - if(handle == NULL || handle->logcb == NULL) { + if(handle == NULL || handle->eventcb == NULL) { return; } - va_start(args, fmt); - handle->logcb(flag, fmt, args); - va_end(args); + va_start(event.args, fmt); + EVENT(handle, &event); + va_end(event.args); } /* vim: set noet: */ -- cgit v1.2.3-24-g4f1b