logger

package
v0.0.0-...-93144e6 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

logger 支持上报 sentry, 错误自动打点中间件等.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(ctx context.Context, args ...interface{})

func Debugf

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

func Error

func Error(ctx context.Context, args ...interface{})

func Errorf

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

func Fatal

func Fatal(ctx context.Context, args ...interface{})

func Fatalf

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

func Info

func Info(ctx context.Context, args ...interface{})

func Infof

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

func New

func New() *defaultLogger

func SetLevel

func SetLevel(level Level)

func SetLogger

func SetLogger(logger Logger)

func Warn

func Warn(ctx context.Context, args ...interface{})

func Warnf

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

Types

type Level

type Level int
const (
	LevelDebug Level = iota
	LevelInfo
	LevelWarn
	LevelError
	LevelFatal
)

type Logger

type Logger interface {
	SetLevel(Level)

	Debug(context.Context, ...interface{})
	Debugf(context.Context, string, ...interface{})

	Info(context.Context, ...interface{})
	Infof(context.Context, string, ...interface{})

	Warn(context.Context, ...interface{})
	Warnf(context.Context, string, ...interface{})

	Error(context.Context, ...interface{})
	Errorf(context.Context, string, ...interface{})

	Fatal(context.Context, ...interface{})
	Fatalf(context.Context, string, ...interface{})
}

func GetLogger

func GetLogger() Logger

Jump to

Keyboard shortcuts

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