Log kits for Golang development.
go get -u github.com/likexian/gokit
import (
"github.com/likexian/gokit/xlog"
)
Visit the docs on GoDoc
log := xlog.New(os.Stderr, xlog.INFO)
log.Info("This is Info")
log.SetLevel(xlog.DEBUG)
log.Debug("This is Debug")
log.Close()
log, err := xlog.File("test.log", xlog.DEBUG)
if err != nil {
panic(err)
}
log.SetFlag(xlog.LstdFlags|xlog.Llongfile)
log.Debug("This is Debug")
log.Info("This is Info")
log.Close()
Copyright 2012-2024 Li Kexian
Licensed under the Apache License 2.0
If this project is helpful, please share it with friends.
If you want to thank me, you can give me a cup of coffee.