From f9e6525871d99a190946eeedae6dcc1e3be7a5c3 Mon Sep 17 00:00:00 2001 From: qiankunli Date: Wed, 22 Dec 2021 20:14:26 +0800 Subject: [PATCH] add StacktraceLevel for zapr Signed-off-by: qiankunli add empty line Signed-off-by: qiankunli remove empty line Signed-off-by: qiankunli --- cmd/training-operator.v1/main.go | 4 +++- go.mod | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/training-operator.v1/main.go b/cmd/training-operator.v1/main.go index 78de5db470..da0c9d3590 100644 --- a/cmd/training-operator.v1/main.go +++ b/cmd/training-operator.v1/main.go @@ -24,6 +24,7 @@ import ( "github.com/kubeflow/training-operator/pkg/config" controller_v1 "github.com/kubeflow/training-operator/pkg/controller.v1" + "go.uber.org/zap/zapcore" // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) // to ensure that exec-entrypoint and run can make use of them. "k8s.io/apimachinery/pkg/runtime" @@ -79,7 +80,8 @@ func main() { config.PyTorchInitContainerTemplateFileDefault, "The template file for pytorch init container") opts := zap.Options{ - Development: true, + Development: true, + StacktraceLevel: zapcore.DPanicLevel, } opts.BindFlags(flag.CommandLine) flag.Parse() diff --git a/go.mod b/go.mod index 92cae6023a..29bd4a2d88 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/onsi/gomega v1.10.2 github.com/prometheus/client_golang v1.10.0 github.com/sirupsen/logrus v1.6.0 + go.uber.org/zap v1.15.0 k8s.io/api v0.19.9 k8s.io/apimachinery v0.19.9 k8s.io/client-go v0.19.9 @@ -65,7 +66,6 @@ require ( github.com/spf13/pflag v1.0.5 // indirect go.uber.org/atomic v1.6.0 // indirect go.uber.org/multierr v1.5.0 // indirect - go.uber.org/zap v1.15.0 // indirect golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect golang.org/x/mod v0.3.0 // indirect golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect