logging

package
v0.4.31 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: GPL-3.0 Imports: 11 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, options ...zap.Option) (*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
}

type WatcherCore added in v0.4.21

type WatcherCore struct {
	zapcore.Core
	// contains filtered or unexported fields
}

func NewWatcherCore added in v0.4.21

func NewWatcherCore() *WatcherCore

func (*WatcherCore) Check added in v0.4.21

func (m *WatcherCore) Check(entry zapcore.Entry, checkedEntry *zapcore.CheckedEntry) *zapcore.CheckedEntry

func (*WatcherCore) Subscribe added in v0.4.21

func (m *WatcherCore) Subscribe(tx chan<- string) string

func (*WatcherCore) Unsubscribe added in v0.4.21

func (m *WatcherCore) Unsubscribe(id string)

func (*WatcherCore) With added in v0.4.21

func (m *WatcherCore) With(fields []zapcore.Field) zapcore.Core

func (*WatcherCore) Write added in v0.4.21

func (m *WatcherCore) Write(entry zapcore.Entry, fields []zapcore.Field) error

Jump to

Keyboard shortcuts

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