type zapLogger … const noLevel … // handleFields converts a bunch of arbitrary key-value pairs into Zap fields. It takes // additional pre-converted Zap fields, for use with automatically attached fields, like // `error`. func (zl *zapLogger) handleFields(lvl int, args []interface{ … } func invokeMarshaler(field string, m logr.Marshaler) (f string, ret interface{ … } func (zl *zapLogger) Init(ri logr.RuntimeInfo) { … } // Zap levels are int8 - make sure we stay in bounds. logr itself should // ensure we never get negative values. func toZapLevel(lvl int) zapcore.Level { … } func (zl zapLogger) Enabled(lvl int) bool { … } func (zl *zapLogger) Info(lvl int, msg string, keysAndVals ...interface{ … } func (zl *zapLogger) Error(err error, msg string, keysAndVals ...interface{ … } func (zl *zapLogger) WithValues(keysAndValues ...interface{ … } func (zl *zapLogger) WithName(name string) logr.LogSink { … } func (zl *zapLogger) WithCallDepth(depth int) logr.LogSink { … } type Underlier … func (zl *zapLogger) GetUnderlying() *zap.Logger { … } // NewLogger creates a new logr.Logger using the given Zap Logger to log. func NewLogger(l *zap.Logger) logr.Logger { … } // NewLoggerWithOptions creates a new logr.Logger using the given Zap Logger to // log and applies additional options. func NewLoggerWithOptions(l *zap.Logger, opts ...Option) logr.Logger { … } type Option … // LogInfoLevel controls whether a numeric log level is added to // Info log message. The empty string disables this, a non-empty // string is the key for the additional field. Errors and // internal panic messages do not have a log level and thus // are always logged without this extra field. func LogInfoLevel(key string) Option { … } // ErrorKey replaces the default "error" field name used for the error // in Logger.Error calls. func ErrorKey(key string) Option { … } // AllowZapFields controls whether strongly-typed Zap fields may // be passed instead of a key/value pair. This is disabled by // default because it breaks implementation agnosticism. func AllowZapFields(allowed bool) Option { … } // DPanicOnBugs controls whether extra log messages are emitted for // invalid log calls with zap's DPanic method. Depending on the // configuration of the zap logger, the program then panics after // emitting the log message which is useful in development because // such invalid log calls are bugs in the program. The log messages // explain why a call was invalid (for example, non-string // key). Emitting them is enabled by default. func DPanicOnBugs(enabled bool) Option { … } var _ … var _ …