log

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: ISC Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	Name   string
	Logger log.Logger
}

Logger wraps a go-kit Logger

func NewFmtLogger added in v0.1.2

func NewFmtLogger(name, logLevel string) *Logger

NewFmtLogger creates a new logger logging using fmt format strings

func NewJSONLogger added in v0.1.2

func NewJSONLogger(name, logLevel string) *Logger

NewJSONLogger creates a new logger logging in JSON

func NewLogger

func NewLogger(logger log.Logger, name, logLevel string) *Logger

NewLogger creates a new logger

func NewNopLogger

func NewNopLogger() *Logger

NewNopLogger creates a new logger for testing purposes

func (*Logger) Debug

func (l *Logger) Debug(kv ...interface{}) error

Debug logs in debug level

func (*Logger) Error

func (l *Logger) Error(kv ...interface{}) error

Error logs in error level

func (*Logger) Info

func (l *Logger) Info(kv ...interface{}) error

Info logs in info level

func (*Logger) SyncLogger added in v0.1.2

func (l *Logger) SyncLogger() *Logger

SyncLogger returns a new logger which can be used concurrently by goroutines. Only one goroutine is allowed to log at a time and other goroutines will block until the logger is available.

func (*Logger) Warn

func (l *Logger) Warn(kv ...interface{}) error

Warn logs in warn level

func (*Logger) With added in v0.1.2

func (l *Logger) With(kv ...interface{}) *Logger

With returns a new logger which always logs a set of key-value pairs

Jump to

Keyboard shortcuts

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