log

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Infof   = defaultLogger.Infof
	Errorf  = defaultLogger.Errorf
	Context = defaultLogger.Context
)
View Source
var TimeFormat = "2006-01-02 15:04:05"

Time format for logs

Functions

func ContextWithLogger

func ContextWithLogger(ctx context.Context, logger Logger) context.Context

Types

type LogFmt

type LogFmt interface {
	Infof(...interface{})
	Errorf(...interface{})
}

type Logger

type Logger interface {
	Context(string) Logger
	Infof(string, ...interface{})
	Errorf(string, ...interface{})

	LogFmt() LogFmt
}

func FromContext

func FromContext(ctx context.Context) Logger

func NewLogger

func NewLogger() Logger

Jump to

Keyboard shortcuts

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