Skip to content

Commit

Permalink
add log filename and line number
Browse files Browse the repository at this point in the history
  • Loading branch information
nayihz committed May 6, 2022
1 parent e5fdd9b commit bee7083
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
// to ensure that exec-entrypoint and run can make use of them.
_ "k8s.io/client-go/plugin/pkg/client/auth"

zaplog "go.uber.org/zap"
"go.uber.org/zap/zapcore"
schedulingv1 "k8s.io/api/scheduling/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -70,6 +71,7 @@ func main() {

opts := zap.Options{
TimeEncoder: zapcore.RFC3339NanoTimeEncoder,
ZapOpts: []zaplog.Option{zaplog.AddCaller(), zaplog.AddCallerSkip(-1)},
}
opts.BindFlags(flag.CommandLine)
flag.Parse()
Expand Down

0 comments on commit bee7083

Please sign in to comment.