From 3e6bfd4a18467742be3fec2e1edb924b8a49f2b2 Mon Sep 17 00:00:00 2001 From: namhq1989 Date: Tue, 23 Aug 2022 16:10:31 +0700 Subject: [PATCH] add data --- logger.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/logger.go b/logger.go index 0a7e30d..92d4533 100644 --- a/logger.go +++ b/logger.go @@ -8,7 +8,11 @@ import ( type ( // LogData for tracking - LogData map[string]interface{} + LogData struct { + Source string + Message string + Data interface{} + } ) var ( @@ -19,7 +23,7 @@ var ( // Init ... func Init(appName, server string) { cfg := zap.Config{ - Encoding: "json", + Encoding: "console", Level: zap.NewAtomicLevelAt(zapcore.DebugLevel), OutputPaths: []string{"stdout"}, InitialFields: map[string]interface{}{"server": server, "capture": appName},