From e6b81095e3ebe5d6ce00540fadb6b146ce984ed6 Mon Sep 17 00:00:00 2001 From: MUzairS15 Date: Fri, 4 Oct 2024 20:44:18 +0530 Subject: [PATCH] initialize logger correctly Signed-off-by: MUzairS15 --- cmd/kanvas-snapshot/main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/kanvas-snapshot/main.go b/cmd/kanvas-snapshot/main.go index 684d243ccb..a843963f01 100644 --- a/cmd/kanvas-snapshot/main.go +++ b/cmd/kanvas-snapshot/main.go @@ -56,7 +56,7 @@ var generateKanvasSnapshotCmd = &cobra.Command{ -h Help for Helm Kanvas Snapshot plugin`, RunE: func(cmd *cobra.Command, args []string) error { - Log = log.SetupMeshkitLogger("helm-kanvas-snapshot", false, os.Stdout) + // Use the extracted name from URI if not provided if designName == "" { designName = ExtractNameFromURI(chartURI) @@ -267,3 +267,9 @@ func main() { } } + +func init() { + cobra.OnInitialize(func() { + Log = log.SetupMeshkitLogger("helm-kanvas-snapshot", false, os.Stdout) + }) +}