wlcore

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encoder

func Encoder(encodeLevel string, isJson bool) zapcore.Encoder

func LevelEncoder

func LevelEncoder(EncodeLevel string) zapcore.LevelEncoder

LevelEncoder 根据 EncodeLevel 返回 zapcore.LevelEncoder

Types

type LogFormatConfig

type LogFormatConfig struct {
	Level           zapcore.Level        // 日志级别
	Prefix          string               // 日志前缀
	IsJson          bool                 // 是否采用json格式
	EncoderLevel    string               // 编码格式
	StacktraceLevel zapcore.LevelEnabler // 打印堆栈信息的等级
}

LogFormatConfig 用于指定日志的各项格式化设置

func NewLogFormatConfig

func NewLogFormatConfig() *LogFormatConfig

NewLogFormatConfig 初始化默认值

type LogSummary

type LogSummary struct {
	LocalFileWriter writer.LogWriter // 本地文件日志写入
	KafkaWriter     writer.LogWriter // 向各类消息队列发送日志信息
	SysLogWriter    writer.LogWriter // syslog形式的日志
	LogFormatConfig *LogFormatConfig // 日志格式配置
}

func (*LogSummary) BuildWriters

func (ls *LogSummary) BuildWriters() []zapcore.WriteSyncer

BuildWriters 新增符合zap要求的Writer

type Loptions

type Loptions struct {
	Package string // 包名
	Option  []any  // 其他需要打印的选项
}

Jump to

Keyboard shortcuts

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