From 566ad61e8624ce0116eebde8cd19a429c500d3d3 Mon Sep 17 00:00:00 2001 From: Erzha E Date: Fri, 18 Oct 2024 00:28:10 +0700 Subject: [PATCH] chore: remove timestamp because it have built-in time --- logger.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/logger.go b/logger.go index 566eeb3..443f014 100644 --- a/logger.go +++ b/logger.go @@ -5,7 +5,6 @@ import ( "io" "log/slog" "os" - "time" ) type ( @@ -44,13 +43,11 @@ func NewLogger(serviceName string, level slog.Level, out io.Writer) Logger { func (l *logger) log(ctx context.Context, level slog.Level, msg string, args ...any) { l.slog.LogAttrs(ctx, level, msg, - slog.String("timestamp", time.Now().Format(time.RFC3339)), slog.Any("data", args)) } func (l *logger) logWithFields(ctx context.Context, level slog.Level, msg string, fields map[string]interface{}) { - attrs := make([]slog.Attr, 0, len(fields)+1) - attrs = append(attrs, slog.String("timestamp", time.Now().Format(time.RFC3339))) + attrs := make([]slog.Attr, 0) for k, v := range fields { attrs = append(attrs, slog.Any(k, v))