Skip to content

Commit e7d7f4c

Browse files
Update pkg/log/zap/zap.go
Co-Authored-By: Haseeb Tariq <hasbro17@gmail.com>
1 parent d17d9c9 commit e7d7f4c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/log/zap/zap.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,10 @@ func (o *Options) BindFlags(fs *flag.FlagSet) {
242242
"Zap Level at and above which stacktraces are captured (one of 'warn' or 'error')")
243243
}
244244

245-
// UseFlagOptions to set logger with CLI passed flags.
245+
// UseFlagOptions configures the logger to use the Options set by parsing zap option flags from the CLI.
246+
// opts := zap.Options{}
247+
// opts.BindFlags(flag.CommandLine)
248+
// log := zap.New(zap.UseFlagOptions(&opts))
246249
func UseFlagOptions(in *Options) Opts {
247250
return func(o *Options) {
248251
*o = *in

0 commit comments

Comments
 (0)