mirror of
https://codeberg.org/woodpecker-plugins/go-plugin.git
synced 2024-11-24 22:35:39 +01:00
Exclude time from log (#2)
Co-authored-by: Lauris BH <lauris@nix.lv> Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/2
This commit is contained in:
parent
e5ca84b806
commit
8208462a69
@ -41,7 +41,10 @@ func SetupConsoleLogger(c *cli.Context) error {
|
|||||||
log.Fatal().Msgf("unknown logging level: %s", level)
|
log.Fatal().Msgf("unknown logging level: %s", level)
|
||||||
}
|
}
|
||||||
zerolog.SetGlobalLevel(lvl)
|
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 {
|
if zerolog.GlobalLevel() <= zerolog.DebugLevel {
|
||||||
log.Logger = log.With().Caller().Logger()
|
log.Logger = log.With().Caller().Logger()
|
||||||
log.Log().Msgf("LogLevel = %s", zerolog.GlobalLevel().String())
|
log.Log().Msgf("LogLevel = %s", zerolog.GlobalLevel().String())
|
||||||
|
Loading…
Reference in New Issue
Block a user