log

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(format string)

func Debugf

func Debugf(format string, args ...any)

func Error

func Error(args ...any)

func Errorf

func Errorf(format string, args ...any)

func Fatalf

func Fatalf(format string, args ...any)

func Info

func Info(args ...any)

func Infof

func Infof(format string, args ...any)

func Init

func Init(opts ...Option) error

Init 替换以将日志输出到文件

func NewLogger

func NewLogger(logger *log.Logger)

func Tracef

func Tracef(format string, args ...any)

func Warnf

func Warnf(format string, args ...any)

Types

type ConfigOption added in v0.0.2

type ConfigOption struct {
	Out io.Writer
}

ConfigOption 持有可选参数

type Option added in v0.0.2

type Option func(*ConfigOption)

Option 使用函数定义一个配置选项类型

func WithFileOut added in v0.0.2

func WithFileOut(logFile string) Option

func WithRotatingFileWriter added in v0.0.2

func WithRotatingFileWriter(logFilePath, logFileName string) Option

type RotatingFileWriter added in v0.0.2

type RotatingFileWriter struct {
	// contains filtered or unexported fields
}

RotatingFileWriter 管理日志滚动的结构体

func NewRotatingFileWriter added in v0.0.2

func NewRotatingFileWriter(filePath, fileName string) *RotatingFileWriter

NewRotatingFileWriter 创建一个新的 RotatingFileWriter 实例

func (*RotatingFileWriter) Write added in v0.0.2

func (r *RotatingFileWriter) Write(p []byte) (n int, err error)

Write 实现 io.Writer 接口,写入数据

type ServiceProviderLogger

type ServiceProviderLogger struct {
	*log.Logger
}

Jump to

Keyboard shortcuts

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