logging

package
v0.13.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldsFromEnv

func FieldsFromEnv(env []string) []zapcore.Field

FieldsFromEnv extracts log fields from environment variables. If an environment variable starts with LOG_FIELD_, the suffix is extracted and split on =. The first part is used for the name and the second for the value. For example, LOG_FIELD_foo=bar would result in a field named "foo" with the value "bar".

func FileLogger

func FileLogger(path string) *zap.Logger

FileLogger builds a new logger which logs to the given path.

func Level

func Level() *zap.AtomicLevel

Level gets the current log level.

func Logger

func Logger() *zap.Logger

Logger builds a new logger based on the given flags.

Types

type Options

type Options struct {
	LogLevel *zapcore.Level
	Config   *zap.Config
}

Options holds the zap logger configuration.

Jump to

Keyboard shortcuts

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