logging

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2018 License: Apache-2.0 Imports: 5 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildLogger

func BuildLogger(level Level) *zap.Logger

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

func NewNullGRPCLogger

func NewNullGRPCLogger() grpclog.Logger

NewNullGRPCLogger returns new grpclog.Logger that log nothing.

useful for debugging to suppress lot of errors from gRPC transport when external service is unavailable

Note: logger must be set into the init() function, e.g:

		func init() {
    		grpclog.SetLogger(logging.NewNullGRPCLogger())
		}

Types

type Config added in v0.4.1

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

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) 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 NullLogger

type NullLogger struct{}

func (*NullLogger) Fatal

func (n *NullLogger) Fatal(args ...interface{})

func (*NullLogger) Fatalf

func (n *NullLogger) Fatalf(format string, args ...interface{})

func (*NullLogger) Fatalln

func (n *NullLogger) Fatalln(args ...interface{})

func (*NullLogger) Print

func (n *NullLogger) Print(args ...interface{})

func (*NullLogger) Printf

func (n *NullLogger) Printf(format string, args ...interface{})

func (*NullLogger) Println

func (n *NullLogger) Println(args ...interface{})

Jump to

Keyboard shortcuts

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