kitlogrus

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2018 License: MIT Imports: 6 Imported by: 0

README

kitlogrus

implement of go-kit log format by logrus

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Log(keyvals ...interface{}) error

	Print(args ...interface{}) // with level NO_LEVEL
	Debug(args ...interface{}) // with level DEBUG
	Info(args ...interface{})  // with level INFO
	Warn(args ...interface{})  // with level WARN
	Error(args ...interface{}) // with level ERROR

	Printf(format string, args ...interface{}) // with level NO_LEVEL
	Debugf(format string, args ...interface{}) // with level DEBUG
	Infof(format string, args ...interface{})  // with level INFO
	Warnf(format string, args ...interface{})  // with level WARN
	Errorf(format string, args ...interface{}) // with level ERROR

	KitLog() log.Logger     // Convert to github.com/go-kit/kit/log Logger struct
	Logrus() *logrus.Logger // Convert to github.com/go-kit/kit/log Logger struct
}

Logger is the fundamental interface for all log operations. Log creates a log event from keyvals, a variadic sequence of alternating keys and values. Implementations must be safe for concurrent use by multiple goroutines. In particular, any implementation of Logger that appends to keyvals or modifies or retains any of its elements must make a copy first.

func NewJSONLogger

func NewJSONLogger(w io.Writer) Logger

NewJSONLogger return a new json logger

func NewLogfmtLogger

func NewLogfmtLogger(w io.Writer) Logger

NewLogfmtLogger return a new logfmt logger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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