From b07e59803d689f80b90a3355838a3999276fdada Mon Sep 17 00:00:00 2001 From: Igor Lazarev Date: Thu, 7 Sep 2023 14:36:57 +0300 Subject: [PATCH] hotfix: logrusadapter --- logging/logrusadapter/adapter.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/logging/logrusadapter/adapter.go b/logging/logrusadapter/adapter.go index dfe00ab..d0350ab 100644 --- a/logging/logrusadapter/adapter.go +++ b/logging/logrusadapter/adapter.go @@ -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)