log

package
v0.0.0-...-a49857f Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

Debug .

func DebugContextf

func DebugContextf(ctx context.Context, format string, args ...interface{})

DebugContextf .

func Debugf

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

Debugf .

func DebugfWithFuncName

func DebugfWithFuncName(format string, args ...interface{})

DebugfWithFuncName 将函数名封装在format前

func Error

func Error(args ...interface{})

Error .

func ErrorContextf

func ErrorContextf(ctx context.Context, format string, args ...interface{})

ErrorContextf .

func Errorf

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

Errorf .

func ErrorfWithFuncName

func ErrorfWithFuncName(format string, args ...interface{})

ErrorfWithFuncName 将函数名封装在format前

func Fatal

func Fatal(args ...interface{})

Fatal .

func FatalContextf

func FatalContextf(ctx context.Context, format string, args ...interface{})

FatalContextf .

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf .

func Info

func Info(args ...interface{})

Info .

func InfoContextf

func InfoContextf(ctx context.Context, format string, args ...interface{})

InfoContextf .

func Infof

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

Infof .

func InfofWithFuncName

func InfofWithFuncName(format string, args ...interface{})

InfofWithFuncName 将函数名封装在format前

func SetLogger

func SetLogger(logger Logger)

SetLogger .

func Sync

func Sync() error

Sync ...

func Warn

func Warn(args ...interface{})

Warn .

func WarnContextf

func WarnContextf(ctx context.Context, format string, args ...interface{})

WarnContextf .

func Warnf

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

Warnf .

Types

type Logger

type Logger interface {
	// Debug logs to DEBUG log. Arguments are handled in the manner of fmt.Print.
	Debug(args ...interface{})
	// Debugf logs to DEBUG log. Arguments are handled in the manner of fmt.Print.
	Debugf(format string, args ...interface{})
	// DebugContextf logs to DEBUG log. Arguments are handled in the manner of fmt.Printf.
	DebugContextf(ctx context.Context, format string, args ...interface{})
	// Info logs to INFO log. Arguments are handled in the manner of fmt.Print.
	Info(args ...interface{})
	// Infof logs to INFO log. Arguments are handled in the manner of fmt.Print.
	Infof(format string, args ...interface{})
	// InfoContextf logs to INFO log. Arguments are handled in the manner of fmt.Printf.
	InfoContextf(ctx context.Context, format string, args ...interface{})
	// Warn logs to WARN log. Arguments are handled in the manner of fmt.Print.
	Warn(args ...interface{})
	// Warnf logs to WARN log. Arguments are handled in the manner of fmt.Printf.
	Warnf(format string, args ...interface{})
	// WarnContextf logs to WARN log. Arguments are handled in the manner of fmt.Printf.
	WarnContextf(ctx context.Context, format string, args ...interface{})
	// Error logs to ERROR log. Arguments are handled in the manner of fmt.Print.
	Error(args ...interface{})
	// Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.
	Errorf(format string, args ...interface{})
	// ErrorContextf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.
	ErrorContextf(ctx context.Context, format string, args ...interface{})
	// Fatal logs to ERROR log. Arguments are handled in the manner of fmt.Print.
	// gRPC ensures that all Fatal logs will exit with os.Exit(1).
	// Implementations may also call os.Exit() with a non-zero exit code.
	Fatal(args ...interface{})
	// Fatalf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.
	// gRPC ensures that all Fatal logs will exit with os.Exit(1).
	// Implementations may also call os.Exit() with a non-zero exit code.
	Fatalf(format string, args ...interface{})
	// FatalContextf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.
	// gRPC ensures that all Fatal logs will exit with os.Exit(1).
	// Implementations may also call os.Exit() with a non-zero exit code.
	FatalContextf(ctx context.Context, format string, args ...interface{})
	// Sync resource close
	Sync() error
}

Logger 日志接口

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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