We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d17d9c9 commit e7d7f4cCopy full SHA for e7d7f4c
pkg/log/zap/zap.go
@@ -242,7 +242,10 @@ func (o *Options) BindFlags(fs *flag.FlagSet) {
242
"Zap Level at and above which stacktraces are captured (one of 'warn' or 'error')")
243
}
244
245
-// UseFlagOptions to set logger with CLI passed flags.
+// 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))
249
func UseFlagOptions(in *Options) Opts {
250
return func(o *Options) {
251
*o = *in
0 commit comments