From 8208462a6979b28482f22baa7e2dfb7099a9c354 Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Mon, 9 Jan 2023 11:53:08 +0000 Subject: [PATCH] Exclude time from log (#2) Co-authored-by: Lauris BH Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/2 --- logger.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/logger.go b/logger.go index 05f65eb..bc361f0 100644 --- a/logger.go +++ b/logger.go @@ -41,7 +41,10 @@ func SetupConsoleLogger(c *cli.Context) error { log.Fatal().Msgf("unknown logging level: %s", level) } zerolog.SetGlobalLevel(lvl) - log.Logger = zerolog.New(zerolog.ConsoleWriter{Out: os.Stdout}).With().Timestamp().Logger() + log.Logger = zerolog.New(zerolog.ConsoleWriter{ + Out: os.Stdout, + FieldsExclude: []string{"time"}, + }).With().Timestamp().Logger() if zerolog.GlobalLevel() <= zerolog.DebugLevel { log.Logger = log.With().Caller().Logger() log.Log().Msgf("LogLevel = %s", zerolog.GlobalLevel().String())