log

package
v0.0.0-...-d68cec5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2019 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ZapLogger

func ZapLogger(development bool) logr.Logger

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

func ZapLoggerTo(destWriter io.Writer, development bool, configFuncs ...ConfigFunc) logr.Logger

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`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL