summaryrefslogtreecommitdiff
path: root/src/pacman
diff options
context:
space:
mode:
Diffstat (limited to 'src/pacman')
-rw-r--r--src/pacman/callback.c36
-rw-r--r--src/pacman/callback.h4
-rw-r--r--src/pacman/conf.c1
3 files changed, 18 insertions, 23 deletions
diff --git a/src/pacman/callback.c b/src/pacman/callback.c
index 218772d5..cd77a312 100644
--- a/src/pacman/callback.c
+++ b/src/pacman/callback.c
@@ -270,6 +270,24 @@ void cb_event(alpm_event_t *event)
((alpm_event_database_missing_t *) event)->dbname);
}
break;
+ case ALPM_EVENT_LOG:
+ {
+ alpm_event_log_t *e = (alpm_event_log_t *) event;
+ if(!e->fmt || strlen(e->fmt) == 0) {
+ break;
+ }
+
+ if(on_progress) {
+ char *string = NULL;
+ pm_vasprintf(&string, e->level, e->fmt, e->args);
+ if(string != NULL) {
+ output = alpm_list_add(output, string);
+ }
+ } else {
+ pm_vfprintf(stderr, e->level, e->fmt, e->args);
+ }
+ }
+ break;
/* all the simple done events, with fallthrough for each */
case ALPM_EVENT_FILECONFLICTS_DONE:
case ALPM_EVENT_CHECKDEPS_DONE:
@@ -777,22 +795,4 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total)
return;
}
-/* Callback to handle notifications from the library */
-void cb_log(alpm_loglevel_t level, const char *fmt, va_list args)
-{
- if(!fmt || strlen(fmt) == 0) {
- return;
- }
-
- if(on_progress) {
- char *string = NULL;
- pm_vasprintf(&string, level, fmt, args);
- if(string != NULL) {
- output = alpm_list_add(output, string);
- }
- } else {
- pm_vfprintf(stderr, level, fmt, args);
- }
-}
-
/* vim: set noet: */
diff --git a/src/pacman/callback.h b/src/pacman/callback.h
index 18939939..f16f7fc8 100644
--- a/src/pacman/callback.h
+++ b/src/pacman/callback.h
@@ -40,10 +40,6 @@ void cb_dl_total(off_t total);
/* callback to handle display of download progress */
void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total);
-/* callback to handle messages/notifications from pacman library */
-__attribute__((format(printf, 2, 0)))
-void cb_log(alpm_loglevel_t level, const char *fmt, va_list args);
-
#endif /* _PM_CALLBACK_H */
/* vim: set noet: */
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index 729c9cb6..f75f3a76 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -685,7 +685,6 @@ static int setup_libalpm(void)
}
config->handle = handle;
- alpm_option_set_logcb(handle, cb_log);
alpm_option_set_dlcb(handle, cb_dl_progress);
alpm_option_set_eventcb(handle, cb_event);
alpm_option_set_questioncb(handle, cb_question);