Show alpm warnings

This commit is contained in:
morganamilo 2018-07-26 13:35:19 +01:00
parent f4aa7f7933
commit 42a74c41c5
No known key found for this signature in database
GPG key ID: 6FE9E7996B0B082E
2 changed files with 10 additions and 0 deletions

View file

@ -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)
}
}

View file

@ -191,6 +191,7 @@ func initAlpmHandle() (err error) {
}
alpmHandle.SetQuestionCallback(questionCallback)
alpmHandle.SetLogCallback(logCallback)
return
}