logger

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, fields ...zap.Field)

func Error

func Error(msg string, fields ...zap.Field)

func GetLogger

func GetLogger() *zap.Logger

func Info

func Info(msg string, fields ...zap.Field)

func NewLogger

func NewLogger(opt *Option)

func Sync

func Sync()

func Warn

func Warn(msg string, fields ...zap.Field)

Types

type LogFormat added in v1.3.0

type LogFormat string
const (
	TEXT LogFormat = "text"
	JSON LogFormat = "json"
)

type LogLevel added in v1.3.0

type LogLevel string
const (
	DEBUG LogLevel = "debug"
	INFO  LogLevel = "info"
	WARN  LogLevel = "warn"
	ERROR LogLevel = "error"
)

type Option

type Option struct {
	Format LogFormat     // 日志格式
	Level  LogLevel      // 日志级别
	Output *OutputConfig // 输出配置
}

type OutputConfig added in v1.3.0

type OutputConfig struct {
	EnableFile bool
	FilePath   string
	MaxAge     int
}

Jump to

Keyboard shortcuts

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