From f24511b2dd49876e05c16b33a22423df3f3b693f Mon Sep 17 00:00:00 2001 From: Itxaka Date: Wed, 16 Oct 2024 17:27:00 +0200 Subject: [PATCH] Enable debug log asap (#578) --- pkg/config/config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/config/config.go b/pkg/config/config.go index 12603fb0..95284df9 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -60,6 +60,10 @@ type Install struct { func NewConfig(opts ...GenericOptions) *Config { log := sdkTypes.NewKairosLogger("agent", "info", false) + // Get the viper config in case something in command line or env var has set it and set the level asap + if viper.GetBool("debug") { + log.SetLevel("debug") + } hostPlatform, err := v1.NewPlatformFromArch(runtime.GOARCH) if err != nil {