@@ -100,7 +100,7 @@ func Encoder(encoder zapcore.Encoder) func(o *Options) {
100
100
101
101
// Level sets the the minimum enabled logging level e.g Debug, Info
102
102
// See Options.Level
103
- func Level (level * zap. AtomicLevel ) func (o * Options ) {
103
+ func Level (level zapcore. LevelEnabler ) func (o * Options ) {
104
104
return func (o * Options ) {
105
105
o .Level = level
106
106
}
@@ -109,7 +109,7 @@ func Level(level *zap.AtomicLevel) func(o *Options) {
109
109
// StacktraceLevel configures the logger to record a stack trace for all messages at
110
110
// or above a given level.
111
111
// See Options.StacktraceLevel
112
- func StacktraceLevel (stacktraceLevel * zap. AtomicLevel ) func (o * Options ) {
112
+ func StacktraceLevel (stacktraceLevel zapcore. LevelEnabler ) func (o * Options ) {
113
113
return func (o * Options ) {
114
114
o .StacktraceLevel = stacktraceLevel
115
115
}
@@ -137,11 +137,11 @@ type Options struct {
137
137
DestWritter io.Writer
138
138
// Level configures the verbosity of the logging. Defaults to Debug when
139
139
// Development is true and Info otherwise
140
- Level * zap. AtomicLevel
140
+ Level zapcore. LevelEnabler
141
141
// StacktraceLevel is the level at and above which stacktraces will
142
142
// be recorded for all messages. Defaults to Warn when Development
143
143
// is true and Error otherwise
144
- StacktraceLevel * zap. AtomicLevel
144
+ StacktraceLevel zapcore. LevelEnabler
145
145
// ZapOpts allows passing arbitrary zap.Options to configure on the
146
146
// underlying Zap logger.
147
147
ZapOpts []zap.Option
@@ -204,7 +204,7 @@ func NewRaw(opts ...Opts) *zap.Logger {
204
204
sink := zapcore .AddSync (o .DestWritter )
205
205
206
206
o .ZapOpts = append (o .ZapOpts , zap .AddCallerSkip (1 ), zap .ErrorOutput (sink ))
207
- log := zap .New (zapcore .NewCore (& KubeAwareEncoder {Encoder : o .Encoder , Verbose : o .Development }, sink , * o .Level ))
207
+ log := zap .New (zapcore .NewCore (& KubeAwareEncoder {Encoder : o .Encoder , Verbose : o .Development }, sink , o .Level ))
208
208
log = log .WithOptions (o .ZapOpts ... )
209
209
return log
210
210
}
@@ -232,17 +232,17 @@ func (o *Options) BindFlags(fs *flag.FlagSet) {
232
232
233
233
// Set the Log Level
234
234
var levelVal levelFlag
235
- levelVal .setFunc = func (fromFlag zap. AtomicLevel ) {
236
- o .Level = & fromFlag
235
+ levelVal .setFunc = func (fromFlag zapcore. LevelEnabler ) {
236
+ o .Level = fromFlag
237
237
}
238
238
fs .Var (& levelVal , "zap-log-level" ,
239
239
"Zap Level to configure the verbosity of logging. Can be one of 'debug', 'info', 'error', " +
240
240
"or any integer value > 0 which corresponds to custom debug levels of increasing verbosity" )
241
241
242
242
// Set the StrackTrace Level
243
243
var stackVal stackTraceFlag
244
- stackVal .setFunc = func (fromFlag zap. AtomicLevel ) {
245
- o .StacktraceLevel = & fromFlag
244
+ stackVal .setFunc = func (fromFlag zapcore. LevelEnabler ) {
245
+ o .StacktraceLevel = fromFlag
246
246
}
247
247
fs .Var (& stackVal , "zap-stacktrace-level" ,
248
248
"Zap Level at and above which stacktraces are captured (one of 'warn' or 'error')" )
0 commit comments