Documentation ¶
Index ¶
Constants ¶
View Source
const Day = time.Hour * 24
Day means 24 hours.
Variables ¶
View Source
var ErrNotStarted = errors.New("not started")
ErrNotStarted 表示没有调用Start方法开始,或者在Close之后继续Write.
View Source
var ErrOverArchiveDays = errors.New("over max archive days")
ErrOverArchiveDays 定义了写入日志的时间超过了ArchiveDays的错误.
Functions ¶
func CreateTarGz ¶
CreateTarGz creates an archive file with archiveName like a/b/c.tar.gz.
func ExtractTarGz ¶
ExtractTarGz extracts files from a tar archive.
func ReplaceAll ¶
ReplaceAll replaces all the search string to replace in subject with case-insensitive.
Types ¶
type File ¶
type File struct { // Pattern 定义了日志文件的布局,例如:/var/logs/{APP}/YYYYMMDD/{APP}_YYYYMMDD_{IP}_ZONE.log. Pattern string // ArchiveDays 定义了多少天之前的日志文件,进行归档。0时不归档. ArchiveDays int // DeleteDays 定义了多少天之前的日志删除(包括归档日志)。0时不删除. DeleteDays int // 是否写入后刷盘. Flush bool Clock clock.Clock // contains filtered or unexported fields }
File 定义了写入日志的结构.
Click to show internal directories.
Click to hide internal directories.