log

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FileRotateLogs = new(fileRotateLogs)
)

Functions

func CustomTimeEncoder

func CustomTimeEncoder(t time.Time, encoder zapcore.PrimitiveArrayEncoder)

func NewZapProvider

func NewZapProvider(path string, inConsole bool, encoderType EncoderType) *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 ...CutterOption) *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 CutterOption

type CutterOption func(*Cutter)

ZapProvider Zap日志服务提供者

func WithCutterFormat

func WithCutterFormat(format string) CutterOption

WithCutterFormat 设置时间格式

type EncoderType

type EncoderType string

ZapProvider Zap日志服务提供者

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

type ZapProvider

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

ZapProvider Zap日志服务提供者

Jump to

Keyboard shortcuts

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