logging

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2018 License: GPL-3.0 Imports: 9 Imported by: 5

Documentation

Index

Constants

View Source
const (
	StdoutLogOutput = "stdout"
	StderrLogOutput = "stderr"
)

Variables

This section is empty.

Functions

func BuildLogger

func BuildLogger(cfg Config) (*zap.Logger, error)

BuildLogger return new zap.Logger instance with given severity and debug settings

func WithTrace added in v0.4.13

func WithTrace(ctx context.Context, log *zap.Logger) *zap.Logger

Types

type Config added in v0.4.1

type Config struct {
	Level  *Level `yaml:"level" required:"true" default:"info"`
	Output string `yaml:"output" default:"stdout"`
}

Config represents a logging config.

func (*Config) LogLevel added in v0.4.1

func (m *Config) LogLevel() Level

type Level added in v0.4.1

type Level struct {
	// contains filtered or unexported fields
}

Level represents a shifted zap logging level that is able to being constructed from YAML.

func NewLevel added in v0.4.1

func NewLevel(level zapcore.Level) *Level

func NewLevelFromString added in v0.4.1

func NewLevelFromString(level string) (*Level, error)

func (Level) MarshalText added in v0.4.6

func (m Level) MarshalText() (text []byte, err error)

func (*Level) UnmarshalYAML added in v0.4.1

func (m *Level) UnmarshalYAML(unmarshal func(interface{}) error) error

func (Level) Zap added in v0.4.1

func (m Level) Zap() zapcore.Level

Zap returns the underlying zap logging level.

type Leveler added in v0.4.1

type Leveler interface {
	// LogLevel return log verbosity.
	LogLevel() Level
}

Jump to

Keyboard shortcuts

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