log

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWriteSync added in v1.5.20

func GetWriteSync(path string, level zapcore.Level, inConsole bool) zapcore.WriteSyncer

GetWriteSync 获取 zapcore.WriteSync

func NewZapProvider

func NewZapProvider(
	path string,
	inConsole bool,
	encoderType EncoderType,
	level zapcore.Level,
) *zap.Logger

NewZapProvider 实例化:Zap日志服务提供者

Types

type Cutter

type Cutter struct {
	Director string // 日志文件夹
	// contains filtered or unexported fields
}

ZapProvider Zap日志服务提供者

func NewCutter

func NewCutter(director string, level string, options ...func(*Cutter)) *Cutter

func (*Cutter) Write

func (c *Cutter) Write(bytes []byte) (n int, err error)

Write satisfies the io.Writer interface. It writes to the appropriate file handle that is currently being used. If we have reached rotation time, the target file gets automatically rotated, and also purged if necessary.

type EncoderType

type EncoderType string

ZapProvider Zap日志服务提供者

const (
	EncoderTypeConsole EncoderType = "CONSOLE"
	EncoderTypeJson    EncoderType = "JSON"
)

Jump to

Keyboard shortcuts

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