Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ZapLogger ¶
ZapLogger is a Logger implementation. If development is true, a Zap development config will be used (stacktraces on warnings, no sampling), otherwise a Zap production config will be used (stacktraces on errors, sampling). Additionally, the time encoding is adjusted to `zapcore.ISO8601TimeEncoder`. This function is mainly copied from controller-runtime `sigs.k8s.io/controller-runtime/pkg/runtime/log` and extended to pass options for log encoding. TODO: Switch back to `sigs.k8s.io/controller-runtime/pkg/runtime/log` once proper options are exposed: https://github.com/kubernetes-sigs/controller-runtime/issues/442
func ZapLoggerTo ¶
ZapLoggerTo returns a new Logger implementation using Zap which logs to the given destination, instead of stderr. It otherise behaves like ZapLogger. This function is mainly copied from controller-runtime `sigs.k8s.io/controller-runtime/pkg/runtime/log` and extended to pass options for log encoding. TODO: Switch back to `sigs.k8s.io/controller-runtime/pkg/runtime/log` once proper options are exposed: https://github.com/kubernetes-sigs/controller-runtime/issues/442
Types ¶
type ConfigFunc ¶
type ConfigFunc func(config *zapcore.EncoderConfig)
ConfigFunc sets configuration Options for `zapcore.EncoderConfig`.