mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-16 18:16:24 -07:00
Make zerolog error Event usage more consistent (Caller on the same line as Err)
This commit is contained in:
parent
c2d834c712
commit
bd6992cb87
13 changed files with 129 additions and 163 deletions
|
@ -107,7 +107,7 @@ func editPost(checkedPosts []int, editBtn string, doEdit string, writer http.Res
|
|||
}
|
||||
post, err := gcsql.GetPostFromID(postid, true)
|
||||
if err != nil {
|
||||
errEv.Err(err).
|
||||
errEv.Err(err).Caller().
|
||||
Int("postid", postid).
|
||||
Msg("Unable to find post")
|
||||
server.ServeError(writer, "Unable to find post: "+err.Error(), wantsJSON, map[string]interface{}{
|
||||
|
|
|
@ -150,11 +150,10 @@ func parseCommandLine() {
|
|||
fmt.Printf("Creating new staff: %q, with password: %q and rank: %d from command line", arr[0], arr[1], rank)
|
||||
if _, err = gcsql.NewStaff(arr[0], arr[1], rank); err != nil {
|
||||
fmt.Printf("Failed creating new staff account for %q: %s\n", arr[0], err.Error())
|
||||
gcutil.LogFatal().
|
||||
gcutil.LogFatal().Err(err).Caller().
|
||||
Str("staff", "add").
|
||||
Str("source", "commandLine").
|
||||
Str("username", arr[0]).
|
||||
Err(err).
|
||||
Msg("Failed creating new staff account")
|
||||
}
|
||||
gcutil.LogInfo().
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue