Improve logging of API errors. (#553)

Previously errors would look like:
ERRO[0008] api error: {bad_data 0xc4201caae0}
source=api.go:534

Now they look like:
ERRO[0001] api error: bad_data: json: cannot unmarshal object into Go
value of type []*types.Alert  source=api.go:534
This commit is contained in:
Brian Brazil 2016-11-18 15:50:15 +00:00 committed by Fabian Reinartz
parent b640c219e5
commit 406aacf141
1 changed files with 1 additions and 1 deletions

View File

@ -531,7 +531,7 @@ func respondError(w http.ResponseWriter, apiErr apiError, data interface{}) {
if err != nil {
return
}
log.Errorf("api error: %s", apiErr)
log.Errorf("api error: %v", apiErr.Error())
w.Write(b)
}