log

package
Version: v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

README

pkg/log

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNullLogger

func NewNullLogger() nullLogger

Types

type Logger

type Logger interface {
	WithField(key string, value interface{}) Logger
	WithFields(fields map[string]interface{}) Logger
	WithError(err error) Logger

	Debug(args ...interface{})
	Debugln(args ...interface{})
	Debugf(format string, args ...interface{})

	Info(args ...interface{})
	Infoln(args ...interface{})
	Infof(format string, args ...interface{})

	Print(args ...interface{})
	Println(args ...interface{})
	Printf(format string, args ...interface{})

	Warning(args ...interface{})
	Warningln(args ...interface{})
	Warningf(format string, args ...interface{})

	Error(args ...interface{})
	Errorln(args ...interface{})
	Errorf(format string, args ...interface{})

	Fatal(args ...interface{})
	Fatalln(args ...interface{})
	Fatalf(format string, args ...interface{})

	V(l int) bool
}

Logger implements grpc's LoggerV2 interface while supporting structured logging by implementing an interface similar to logrus' FieldLogger or apex's Interface.

See:

- https://github.com/grpc/grpc-go/blob/v1.27.1/grpclog/loggerv2.go
- https://github.com/sirupsen/logrus/blob/v1.4.2/logrus.go
- https://github.com/apex/log/blob/v1.1.2/interface.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL