Skip to content

qjpcpu/filelog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Features

  • auto rotate by daily,hourly,minutely,none
  • keep max KeepCount log files
  • auto recreate log file when unexpected deletion

Example

package main

import (
	"github.com/qjpcpu/filelog"
	"log"
)

func main() {
	w, err := filelog.NewWriter("test.log", 
        filelog.CreateShortcut(true),
        filelog.Keep(24),
        filelog.RotateBy(filelog.RotateHourly),
    )
	if err != nil {
		log.Fatal(err)
	}
	w.Write([]byte("hello log"))
	w.Close()
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages