log

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 12 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddField

func AddField(key string, value interface{})

AddField is a convenient alias for Root().AddField

func Debug

func Debug(msg string)

Debug is a convenient alias for Root().Debug

func Error

func Error(err error)

Error is a convenient alias for Root().Error

func Event

func Event(e string, f map[string]interface{})

Event is a convenient alias for Root().Event

func Fatal

func Fatal(err error)

Fatal is a convenient alias for Root().Fatal

func Info

func Info(msg string)

Info is a convenient alias for Root().Info

func Init

func Init(id []byte)

Init setups default field and add hook

func TimeTrack

func TimeTrack(start time.Time, e string, info map[string]interface{})

TimeTrack is a convenient alias for Root().TimeTrack

func Warn

func Warn(msg string)

Warn is a convenient alias for Root().Warn

Types

type Logger

type Logger interface {
	// New returns a new Logger that has this logger's context plus the given context
	New(key string, value interface{}) Logger
	AddField(key string, value interface{})
	Debug(msg string)
	Info(msg string)
	Warn(msg string)
	Error(err error)
	Fatal(err error)
	TimeTrack(time.Time, string, map[string]interface{})
	Event(e string, f map[string]interface{})
}

A Logger writes key/value pairs to a Handler

func New

func New(key string, value interface{}) Logger

New returns a new logger with the given key/value . New is a convenient alias for Root().New

Jump to

Keyboard shortcuts

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