diff options
author | Olivier Brunel <jjk@jjacky.com> | 2014-01-10 16:25:15 +0100 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2014-03-03 11:25:54 +1000 |
commit | cd793c5ab7689cc8cbc18277375b368060e5acfe (patch) | |
tree | a910fef22528f58f2abb38f89a1df354f8f35d62 /lib/libalpm/log.c | |
parent | 28dbd5551ee75e843019e6f067ed069daaabba0b (diff) | |
download | pacman-cd793c5ab7689cc8cbc18277375b368060e5acfe.tar.xz |
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 <jjk@jjacky.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/log.c')
-rw-r--r-- | lib/libalpm/log.c | 14 |
1 files changed, 9 insertions, 5 deletions
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: */ |