core

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2025 License: Apache-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	Debug(msg string, required gox.Field[any], optionals ...gox.Field[any])

	Info(msg string, required gox.Field[any], optionals ...gox.Field[any])

	Warn(msg string, required gox.Field[any], optionals ...gox.Field[any])

	Error(msg string, required gox.Field[any], optionals ...gox.Field[any])

	Panic(msg string, required gox.Field[any], optionals ...gox.Field[any])

	Fatal(msg string, required gox.Field[any], optionals ...gox.Field[any])

	Sync() error
}

type Factory

type Factory interface {
	New() (Executor, error)
}

type Level

type Level string
const (
	LevelDebug Level = "debug"
	LevelInfo  Level = "info"
	LevelWarn  Level = "warn"
	LevelError Level = "error"
	LevelPanic Level = "panic"
	LevelFatal Level = "fatal"
)

func ParseLevel

func ParseLevel(from string) (level Level)

func (Level) Rank

func (l Level) Rank() (rank int)

type Logger

type Logger interface {
	// Level 现在的日志等级
	Level() Level

	// Enable 开启日志级别
	Enable(level Level)

	// Enabled 日志等级是否开启
	Enabled(level Level) bool

	// Debug 记录调试日志
	Debug(msg string, required gox.Field[any], optionals ...gox.Field[any])

	// Info 记录普通信息日志
	Info(msg string, required gox.Field[any], optionals ...gox.Field[any])

	// Warn 记录警告日志
	Warn(msg string, required gox.Field[any], optionals ...gox.Field[any])

	// Error 记录错误日志
	Error(msg string, required gox.Field[any], optionals ...gox.Field[any])

	// Panic 记录异常日志,程序会退出,可以使用recover机制来阻止程序退出
	Panic(msg string, required gox.Field[any], optionals ...gox.Field[any])

	// Fatal 记录致命错误日志,程序会退出
	Fatal(msg string, required gox.Field[any], optionals ...gox.Field[any])

	// Sync 同步
	Sync() error
}

Logger 日志接口

Jump to

Keyboard shortcuts

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