feat: allow logging output to use JSON formatter

Signed-off-by: GridexX <arsene582@gmail.com>
This commit is contained in:
GridexX 2023-07-26 10:13:53 +03:00
parent a5d7f23d2e
commit be98119552
No known key found for this signature in database
4 changed files with 56 additions and 11 deletions

View file

@ -28,17 +28,18 @@ import (
)
var (
client container.Client
scheduleSpec string
cleanup bool
noRestart bool
monitorOnly bool
enableLabel bool
notifier t.Notifier
timeout time.Duration
lifecycleHooks bool
rollingRestart bool
scope string
client container.Client
scheduleSpec string
cleanup bool
noRestart bool
monitorOnly bool
enableLabel bool
enableJsonFormatter bool
notifier t.Notifier
timeout time.Duration
lifecycleHooks bool
rollingRestart bool
scope string
)
var rootCmd = NewRootCommand()
@ -96,6 +97,11 @@ func PreRun(cmd *cobra.Command, _ []string) {
log.SetLevel(logLevel)
}
enableJsonFormatter, _ = f.GetBool("json-logging")
if enableJsonFormatter {
log.SetFormatter(&log.JSONFormatter{})
}
scheduleSpec, _ = f.GetString("schedule")
flags.GetSecretsFromFiles(cmd)