logger

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// EtcdClientFilename is the filename of etcd client log.
	EtcdClientFilename = "etcd_client.log"
)

Variables

This section is empty.

Functions

func APIAccess

func APIAccess(
	method, remoteAddr, path string,
	code int,
	bodyBytedReceived, bodyBytesSent int64,
	requestTime time.Time,
	processTime time.Duration)

APIAccess logs admin api log.

func Debugf

func Debugf(template string, args ...interface{})

Debugf is the wrapper of default logger Debugf.

func Errorf

func Errorf(template string, args ...interface{})

Errorf is the wrapper of default logger Errorf.

func EtcdClientLoggerConfig

func EtcdClientLoggerConfig(opt *option.Options, filename string) *zap.Config

EtcdClientLoggerConfig generates the config of etcd client logger.

func HTTPAccess

func HTTPAccess(template string, args ...interface{})

HTTPAccess logs http access log.

func Infof

func Infof(template string, args ...interface{})

Infof is the wrapper of default logger Infof.

func Init

func Init(opt *option.Options)

Init initializes logger.

func InitMock added in v1.4.1

func InitMock()

InitMock initializes all logger to print stdout, mainly for unit testing

func InitNop added in v1.2.1

func InitNop()

InitNop initializes all logger as nop, mainly for unit testing

func LazyDebug added in v1.3.2

func LazyDebug(fn func() string)

LazyDebug logs debug log in lazy mode. if debug log is disabled by configuration, it skips the the built of log message to improve performance

func LazyHTTPAccess added in v1.3.2

func LazyHTTPAccess(fn func() string)

LazyHTTPAccess logs http access log in lazy mode, if http access log is disabled by configuration, it skips the the built of log message to improve performance

func NginxHTTPAccess

func NginxHTTPAccess(remoteAddr, proto, method, path, referer, agent, realIP string,
	code int, bodyBytesSent int64,
	requestTime time.Duration, upstreamResponseTime time.Duration,
	upstreamAddr string, upstreamCode int, clientWriteBodyTime, clientReadBodyTime,
	routeTime time.Duration)

NginxHTTPAccess is DEPRECATED, replaced by HTTPAccess.

func SpanDebugf added in v1.4.1

func SpanDebugf(context *model.SpanContext, template string, args ...interface{})

SpanDebugf is the wrapper of default logger Debugf to log tracing message

func SpanErrorf added in v1.4.1

func SpanErrorf(context *model.SpanContext, template string, args ...interface{})

SpanErrorf is the wrapper of default logger Debugf to log tracing message

func Sync

func Sync()

Sync syncs all logs, must be called after calling Init().

func Warnf

func Warnf(template string, args ...interface{})

Warnf is the wrapper of default logger Warnf.

Types

This section is empty.

Jump to

Keyboard shortcuts

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