log

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LevelAll   xlog.Level = xlog.LevelAll
	LevelDebug xlog.Level = xlog.LevelDebug
	LevelInfo  xlog.Level = xlog.LevelInfo
	LevelWarn  xlog.Level = xlog.LevelWarn
	LevelError xlog.Level = xlog.LevelError
	LevelPanic xlog.Level = xlog.LevelPanic

	LevelFatal xlog.Level = xlog.LevelFatal
	LevelOff   xlog.Level = xlog.LevelOff
)
View Source
var (
	WithName    = xlog.WithName
	WithSid     = xlog.WithSid
	WithSrvType = xlog.WithSrvType
	WithField   = xlog.WithField
	WithFields  = xlog.WithFields
)

Functions

func Close

func Close()

func Concurrency

func Concurrency(cnt int)

func Debug

func Debug(args ...interface{})

func Debugf

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

func Error

func Error(args ...interface{})

func Errorf

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

func Info

func Info(args ...interface{})

func Infof

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

func Panic

func Panic(args ...interface{})

func Panicf

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

func Register added in v0.1.31

func Register(builder Builder)

func SetBuilder

func SetBuilder(builder Builder)

设置日志的builder

func Warn

func Warn(args ...interface{})

func Warnf

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

func WithContext

func WithContext(ctx context.Context, l Logger) context.Context

Types

type Builder

type Builder interface {
	Name() string
	Build(...Option) Logger
	Close()
}

func GetBuilder added in v0.1.31

func GetBuilder(builderName string) (Builder, bool)

type Level

type Level = xlog.Level

type Logger

type Logger interface {
	Name() string

	SessionID() string

	Log(level Level, args ...interface{})
	Logf(level Level, format string, args ...interface{})

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

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

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

	Panic(args ...interface{})
	Panicf(format string, args ...interface{})

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

	Warn(v ...interface{})
	Warnf(format string, v ...interface{})

	Write(p []byte) (n int, err error)
	Close()
}
var (
	DefaultLogger Logger
)

func FromContext

func FromContext(ctx context.Context) (Logger, bool)

func New

func New(opts ...Option) Logger

type Option

type Option = xlog.Option

type Options added in v0.1.13

type Options struct {
	WithRequest  bool
	WithResponse bool
	Excludes     []string
	// contains filtered or unexported fields
}

func (*Options) IsExclude added in v0.1.13

func (opts *Options) IsExclude(path string) bool

type ServerOption added in v0.1.13

type ServerOption func(opt *Options)

func Excludes deprecated added in v0.1.13

func Excludes(excludes ...string) ServerOption

Deprecated: use func (e *Server) Handle(path string, obj interface{}, opts ...engine.RouterOption) 中Opts代替

func WithRequest added in v0.1.13

func WithRequest() ServerOption

func WithResponse added in v0.1.13

func WithResponse() ServerOption

Jump to

Keyboard shortcuts

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