diff --git a/callbacks.go b/callbacks.go index 1b55a0f6..5d0bd22d 100644 --- a/callbacks.go +++ b/callbacks.go @@ -85,3 +85,12 @@ func questionCallback(question alpm.QuestionAny) { } } } + +func logCallback(level alpm.LogLevel, str string) { + switch level { + case alpm.LogWarning: + fmt.Print(bold(yellow(smallArrow)), " ", str) + case alpm.LogError: + fmt.Print(bold(red(smallArrow)), " ", str) + } +} diff --git a/main.go b/main.go index 3966d38e..1c1ec4b7 100644 --- a/main.go +++ b/main.go @@ -191,6 +191,7 @@ func initAlpmHandle() (err error) { } alpmHandle.SetQuestionCallback(questionCallback) + alpmHandle.SetLogCallback(logCallback) return }