From 6e815e4ddf99cba2b1c94b350a81a2e4470287e5 Mon Sep 17 00:00:00 2001 From: Ryan Rotter Date: Fri, 7 Jun 2024 09:44:45 -0400 Subject: [PATCH 1/2] lower log level to Debug for finding environments This was printing by default on `tk env list` and in the shell completer. --- pkg/tanka/find.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/tanka/find.go b/pkg/tanka/find.go index 7e8950052..d34362653 100644 --- a/pkg/tanka/find.go +++ b/pkg/tanka/find.go @@ -56,7 +56,7 @@ func findEnvsFromPaths(paths []string, opts FindOpts) ([]*v1alpha1.Environment, findEnvsEndTime := time.Now() - log.Info(). + log.Debug(). Int("environments", len(envs)). Dur("ms_to_find_jsonnet_files", findJsonnetFilesEndTime.Sub(startTime)). Dur("ms_to_find_environments", findEnvsEndTime.Sub(findJsonnetFilesEndTime)). From 4dc0755ef566af44a11a6a257a3e709ef2b162ec Mon Sep 17 00:00:00 2001 From: Ryan Rotter Date: Wed, 5 Jun 2024 15:36:06 -0400 Subject: [PATCH 2/2] ensure default log level is set for all commands Set default log level early so tk complete (and any other commands that don't read `--log-level`) won't print debug/trace level logs. --- cmd/tk/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/tk/main.go b/cmd/tk/main.go index b37358c18..b988b4b53 100644 --- a/cmd/tk/main.go +++ b/cmd/tk/main.go @@ -21,6 +21,9 @@ func main() { Version: tanka.CurrentVersion, } + // set default logging level early; not all commands parse --log-level + zerolog.SetGlobalLevel(zerolog.InfoLevel) + // workflow commands addCommandsWithLogLevelOption( rootCmd,