Skip to content

Commit

Permalink
hotfix: logrusadapter
Browse files Browse the repository at this point in the history
  • Loading branch information
strider2038 authored Sep 7, 2023
1 parent e6d54eb commit b07e598
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions logging/logrusadapter/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,17 @@ func (a *adapter) SetStackTrace(trace errors.StackTrace) {
a.log = a.log.WithField("stackTrace", frames)
}

type levelLogger interface {
Log(level logrus.Level, args ...interface{})
}

func (a *adapter) Log(message string) {
if levelLog, ok := a.log.(levelLogger); ok {
levelLog.Log(a.level, message)

return
}

switch a.level {
case logrus.PanicLevel:
a.log.Panic(message)
Expand Down

0 comments on commit b07e598

Please sign in to comment.