internal

package
v0.0.0-...-18e9b6d Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigEnv         = "GVA_CONFIG"
	ConfigDefaultFile = "config.yaml"
	ConfigTestFile    = "config.test.yaml"
	ConfigDebugFile   = "config.debug.yaml"
	ConfigReleaseFile = "config.release.yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cutter

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

Cutter 实现 io.Writer 接口 用于日志切割, strings.Join([]string{director,layout, formats..., level+".log"}, os.PathSeparator)

func NewCutter

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

func (*Cutter) Sync

func (c *Cutter) Sync() error

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)

func CutterWithFormats

func CutterWithFormats(format ...string) CutterOption

CutterWithFormats 格式化参数

func CutterWithLayout

func CutterWithLayout(layout string) CutterOption

CutterWithLayout 时间格式

type ZapCore

type ZapCore struct {
	zapcore.Core
	// contains filtered or unexported fields
}

func NewZapCore

func NewZapCore(level zapcore.Level) *ZapCore

func (*ZapCore) Check

func (z *ZapCore) Check(entry zapcore.Entry, check *zapcore.CheckedEntry) *zapcore.CheckedEntry

func (*ZapCore) Enabled

func (z *ZapCore) Enabled(level zapcore.Level) bool

func (*ZapCore) Sync

func (z *ZapCore) Sync() error

func (*ZapCore) With

func (z *ZapCore) With(fields []zapcore.Field) zapcore.Core

func (*ZapCore) Write

func (z *ZapCore) Write(entry zapcore.Entry, fields []zapcore.Field) error

func (*ZapCore) WriteSyncer

func (z *ZapCore) WriteSyncer(formats ...string) zapcore.WriteSyncer

Jump to

Keyboard shortcuts

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