filelog

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

View Source
const MaxBufferd = 1024 * 500

MaxBufferd buffer最大值

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Dir    string
	File   string
	Expire int
	Period LogPeriod
	Level  log.Level
}

Config filelog-Transporter所需配置

type FileWriterByPeriod

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

FileWriterByPeriod 文件周期写入

func NewFileWriteByPeriod

func NewFileWriteByPeriod() *FileWriterByPeriod

NewFileWriteByPeriod 获取新的FileWriterByPeriod

func (*FileWriterByPeriod) Close

func (w *FileWriterByPeriod) Close()

Close 关闭

func (*FileWriterByPeriod) Open

func (w *FileWriterByPeriod) Open()

Open 打开

func (*FileWriterByPeriod) Set

func (w *FileWriterByPeriod) Set(dir, file string, period LogPeriod, expire time.Duration)

Set 设置

func (*FileWriterByPeriod) Write

func (w *FileWriterByPeriod) Write(p []byte) (n int, err error)

type LogPeriod

type LogPeriod interface {
	String() string
	FormatLayout() string
}

LogPeriod 日志周期

func ParsePeriod

func ParsePeriod(v string) (LogPeriod, error)

ParsePeriod 解析周期

type LogPeriodType

type LogPeriodType int

LogPeriodType 日志周期类型

const (
	//PeriodMonth 月
	PeriodMonth LogPeriodType = iota
	//PeriodDay 日
	PeriodDay
	//PeriodHour 时
	PeriodHour
)

func (LogPeriodType) FormatLayout

func (period LogPeriodType) FormatLayout() string

FormatLayout 格式化

func (LogPeriodType) String

func (period LogPeriodType) String() string

type Transporter

type Transporter struct {
	*eosc_log.Transporter
	// contains filtered or unexported fields
}

Transporter filelog-Transporter结构

func CreateTransporter

func CreateTransporter(level eosc_log.Level) *Transporter

CreateTransporter 创建filelog-Transporter

func (*Transporter) Close

func (t *Transporter) Close() error

Close 关闭

func (*Transporter) Reset

func (t *Transporter) Reset(c interface{}, f eosc_log.Formatter) error

Reset 重置配置

Jump to

Keyboard shortcuts

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