logging

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfigFromConfigMap

func NewConfigFromConfigMap(configMap *corev1.ConfigMap) (*logging.Config, error)

NewConfigFromConfigMap creates a LoggingConfig from the supplied ConfigMap

func NewConfigFromMap

func NewConfigFromMap(data map[string]string) (*logging.Config, error)

NewConfigFromMap creates a LoggingConfig from the supplied map

func NewLogger

func NewLogger(configJSON string, levelOverride string) (*zap.SugaredLogger, zap.AtomicLevel)

NewLogger creates a logger with the supplied configuration. In addition to the logger, it returns AtomicLevel that can be used to change the logging level at runtime. If configuration is empty, a fallback configuration is used. If configuration cannot be used to instantiate a logger, the same fallback configuration is used.

func NewLoggerFromConfig

func NewLoggerFromConfig(config *logging.Config, name string) (*zap.SugaredLogger, zap.AtomicLevel)

NewLoggerFromConfig creates a logger using the provided Config

func NewSyncFileWriter

func NewSyncFileWriter(file *os.File) io.Writer

NewSyncFileWriter returns an io.Writer that is backed by an os.File and that synchronizes the writes to the file. This is suitable for use with non-threadsafe writers, e.g. os.Stdout.

func UpdateLevelFromConfigMap

func UpdateLevelFromConfigMap(logger *zap.SugaredLogger, atomicLevel zap.AtomicLevel, levelKey string) func(configMap *corev1.ConfigMap)

UpdateLevelFromConfigMap returns a helper func that can be used to update the logging level when a config map is updated

Types

This section is empty.

Jump to

Keyboard shortcuts

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