log

package
v0.0.0-...-f816739 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// normal logger
	Info  func(context.Context, string, ...interface{})
	Warn  func(context.Context, string, ...interface{})
	Error func(context.Context, string, ...interface{})
	Sync  func()
)
View Source
var (
	// access logger
	Access func(AccessLog)
)

Functions

func TraceId

func TraceId(ctx context.Context) string

Types

type AccessLog

type AccessLog struct {
	RemoteAddr           string
	Method               string
	Proto                string
	RequestContentLength int64
	Host                 string
	RequestURI           string
	Status               int
	Url                  string
	UserAgent            string
	RequestTime          int64
}

type AccessLogger

type AccessLogger interface {
	Access(AccessLog)
}

type Logger

type Logger interface {
	Info(context.Context, string, ...interface{})
	Warn(context.Context, string, ...interface{})
	Error(context.Context, string, ...interface{})
	Sync()
}

Jump to

Keyboard shortcuts

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