From 86ef87b907461da57a142717e5d1a9f36f1834fb Mon Sep 17 00:00:00 2001 From: "i.navrotskyj" Date: Thu, 12 Dec 2024 13:37:30 +0200 Subject: [PATCH] log_console --- app/config.go | 4 ++++ model/config.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/config.go b/app/config.go index ae5c007..f81b01b 100644 --- a/app/config.go +++ b/app/config.go @@ -36,5 +36,9 @@ func loadConfig() (*model.Config, error) { //return nil, err } + if !config.Log.Console && !config.Log.Otel && len(config.Log.File) == 0 { + config.Log.Console = true + } + return &config, nil } diff --git a/model/config.go b/model/config.go index 56e3b6d..f5c138a 100644 --- a/model/config.go +++ b/model/config.go @@ -17,7 +17,7 @@ type LogSettings struct { Json bool `json:"json" flag:"log_json|false|Log format JSON" env:"LOG_JSON"` Otel bool `json:"otel" flag:"log_otel|false|Log OTEL" env:"LOG_OTEL"` File string `json:"file" flag:"log_file||Log file directory" env:"LOG_FILE"` - Console bool `json:"console" flag:"log_console|1|Log console" env:"LOG_CONSOLE"` + Console bool `json:"console" flag:"log_console|false|Log console" env:"LOG_CONSOLE"` } type CallSettings struct {