log

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: MIT Imports: 1 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Key      string
	Type     FieldType
	String   string
	Int      int
	Duration time.Duration
	Error    error
}

func Duration

func Duration(key string, value time.Duration) Field

func Error

func Error(err error) Field

func Int

func Int(key string, value int) Field

func String

func String(key string, value string) Field

type FieldType

type FieldType int
const (
	StringType FieldType = iota
	IntType
	DurationType
	ErrorType
)

type Logger

type Logger interface {
	Trace(msg string, fields ...Field)
	Debug(msg string, fields ...Field)
	Info(msg string, fields ...Field)
	Warn(msg string, fields ...Field)
	Error(msg string, fields ...Field)
	Sub(fields ...Field) Logger
}
var DefaultLogger Logger = NewNopLogger()

func NewNopLogger

func NewNopLogger() Logger

Jump to

Keyboard shortcuts

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