logging

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2018 License: Apache-2.0 Imports: 7 Imported by: ? 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 FromContext

func FromContext(ctx context.Context) *zap.SugaredLogger

FromContext returns the logger stored in context. Returns nil if no logger is set in context, or if the stored value is not of correct type.

func NewLogger

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

NewLogger creates a logger with the supplied configuration. 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 NewLoggerFromDefaultConfigMap

func NewLoggerFromDefaultConfigMap(logLevelKey string) *zap.SugaredLogger

NewLoggerFromDefaultConfigMap creates a logger using the configuration within /etc/config-logging file.

func WithLogger

func WithLogger(ctx context.Context, logger *zap.SugaredLogger) context.Context

WithLogger returns a copy of parent context in which the value associated with logger key is the supplied logger.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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