log

package
v0.0.0-...-4b954a8 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2018 License: MIT Imports: 4 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DebugLevel = zapcore.DebugLevel
	InfoLevel  = zapcore.InfoLevel
	WarnLevel  = zapcore.WarnLevel
	ErrorLevel = zapcore.ErrorLevel
	PanicLevel = zapcore.PanicLevel
	FatalLevel = zapcore.FatalLevel
)
View Source
var (
	Any         = zap.Any
	Binary      = zap.Binary
	Bool        = zap.Bool
	Bools       = zap.Bools
	ByteString  = zap.ByteString
	ByteStrings = zap.ByteStrings
	Complex64   = zap.Complex64
	Complex64s  = zap.Complex64s
	Complex128  = zap.Complex128
	Complex128s = zap.Complex128s
	Duration    = zap.Duration
	Durations   = zap.Durations
	Error       = zap.Error
	Errors      = zap.Errors
	Float32     = zap.Float32
	Float32s    = zap.Float32s
	Float64     = zap.Float64
	Float64s    = zap.Float64s
	Int         = zap.Int
	Ints        = zap.Ints
	Int8        = zap.Int8
	Int8s       = zap.Int8s
	Int16       = zap.Int16
	Int16s      = zap.Int16s
	Int32       = zap.Int32
	Int32s      = zap.Int32s
	Int64s      = zap.Int64s
	NamedError  = zap.NamedError
	Stack       = zap.Stack
	String      = zap.String
	Strings     = zap.Strings
	Stringer    = zap.Stringer
	Time        = zap.Time
	Times       = zap.Times
	Uint        = zap.Uint
	Uints       = zap.Uints
	Uint8       = zap.Uint8
	Uint8s      = zap.Uint8s
	Uint16      = zap.Uint16
	Uint16s     = zap.Uint16s
	Uint32      = zap.Uint32
	Uint32s     = zap.Uint32s
	Uint64      = zap.Uint64
	Uint64s     = zap.Uint64s
	Uintptr     = zap.Uintptr
	Uintptrs    = zap.Uintptrs
)
View Source
var (
	NullLogger = fromZap(zap.NewNop(), nil)
)

Functions

This section is empty.

Types

type Field

type Field = zapcore.Field

func NamedRequest

func NamedRequest(key string, value *http.Request) Field

func Request

func Request(value *http.Request) Field

type Level

type Level = zapcore.Level

type Logger

type Logger interface {
	Debug(msg string, fields ...Field)
	Error(msg string, fields ...Field)
	Fatal(msg string, fields ...Field)
	Info(msg string, fields ...Field)
	Panic(msg string, fields ...Field)
	Warn(msg string, fields ...Field)
	Named(s string) Logger
	With(fields ...Field) Logger
	Sync() error
	NewStdLogAt(level Level) (*stdlog.Logger, error)
}

func NewDevelopment

func NewDevelopment() Logger

Tries to create a new logger suitable for debugging.

It will log to the console in a human readable format and will log everything from Debug upwards (so, everything).

If there is a problem creating the backing logger it will panic.

func NewProduction

func NewProduction() Logger

Jump to

Keyboard shortcuts

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