Simple time based and thread safe logger. internally uses the log package
https://github.com/arriqaaq/qalam
- Create a simple log file handler, will do log rotation automatically.
- Completely thread safe and can be used inside multiple go routines
go get -u github.com/sankalpjonn/pen
The example below logs to a file with (%Y%m%d) format:
package main
import (
"github.com/sankalpjonn/pen"
)
func main() {
p := pen.New("LOG-PREFIX", "/tmp/log.%Y%m%d")
p.Write("foo")
p.Write("bar")
// to close the pen
p.Lid()
}