From fd471a89e231650a842e0e2403f1780c99670b41 Mon Sep 17 00:00:00 2001 From: Evstigneev Denis Date: Mon, 18 Sep 2023 10:59:21 +0300 Subject: [PATCH] deleted unnecessary operations --- logger/slog.go | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/logger/slog.go b/logger/slog.go index 483edd3e..9b174ffa 100644 --- a/logger/slog.go +++ b/logger/slog.go @@ -103,12 +103,6 @@ func (s *slogLogger) Log(ctx context.Context, lvl Level, args ...any) { log.Fatalln(msg, attr) } - if slvl == slog.LevelError { - l := s.slog.With(slog.Any("ProcStatus", "ERROR"), slog.Any("ErrorText", msg)) - l.LogAttrs(ctx, slvl, "", attr...) - return - } - s.slog.LogAttrs(ctx, slvl, msg, attr...) } @@ -125,12 +119,6 @@ func (s *slogLogger) Logf(ctx context.Context, lvl Level, format string, args .. log.Fatalln(msg, attr) } - if slvl == slog.LevelError { - l := s.slog.With(slog.Any("ProcStatus", "ERROR"), slog.Any("ErrorText", msg)) - l.LogAttrs(ctx, slvl, "", attr...) - return - } - s.slog.LogAttrs(ctx, slvl, msg, attr...) } @@ -229,9 +217,6 @@ func renameTime(groups []string, a slog.Attr) slog.Attr { if a.Key == slog.TimeKey { a.Key = "@timestamp" } - if a.Key == slog.MessageKey { - a.Key = "message" - } return a }