From d4b3bbf04949a73d16cd4eed12eba8ad4bda136f Mon Sep 17 00:00:00 2001 From: FogDong Date: Tue, 9 Aug 2022 21:02:21 +0800 Subject: [PATCH] Fix: fix writing logs to file Signed-off-by: FogDong --- cmd/core/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/core/main.go b/cmd/core/main.go index 7f2eb49ec..41388c88d 100644 --- a/cmd/core/main.go +++ b/cmd/core/main.go @@ -19,6 +19,7 @@ package main import ( "context" "errors" + goflag "flag" "fmt" "io" "net/http" @@ -148,9 +149,10 @@ func main() { flag.IntVar(&wfTypes.MaxWorkflowStepErrorRetryTimes, "max-workflow-step-error-retry-times", 10, "Set the max workflow step error retry times, default is 10") utilfeature.DefaultMutableFeatureGate.AddFlag(flag.CommandLine) - flag.Parse() // setup logging klog.InitFlags(nil) + flag.CommandLine.AddGoFlagSet(goflag.CommandLine) + flag.Parse() if logDebug { _ = flag.Set("v", strconv.Itoa(int(commonconfig.LogDebug))) }