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
}