Skip to content

Commit

Permalink
feat: add err log convenience funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
revitteth committed Jan 26, 2022
1 parent 0714df2 commit 518cc97
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,28 @@ func (z *Zaplog) FatalRedact(s string) *Zaplog {
z.Fatal(z.Redact(s))
return z
}

func (z *Zaplog) InfoErr(e error) *Zaplog {
z.Logger.Info(e.Error())
return z
}

func (z *Zaplog) DebugErr(e error) *Zaplog {
z.Logger.Debug(e.Error())
return z
}

func (z *Zaplog) WarnErr(e error) *Zaplog {
z.Logger.Warn(e.Error())
return z
}

func (z *Zaplog) ErrorErr(e error) *Zaplog {
z.Logger.Error(e.Error())
return z
}

func (z *Zaplog) PanicErr(e error) *Zaplog {
z.Logger.Panic(e.Error())
return z
}

0 comments on commit 518cc97

Please sign in to comment.