LLog - Monolog implementation in Go.
go get github.com/syyongx/llog
package main
import (
"github.com/syyongx/llog"
"github.com/syyongx/llog/handler"
"github.com/syyongx/llog/formatter"
"github.com/syyongx/llog/types"
)
func main()
// New logger{
logger := NewLogger("my-log")
file := handler.NewFile("/tmp/llog/go.log", 0664, types.WARNING, true)
buf := handler.NewBuffer(file, 1, types.WARNING, true)
f := formatter.NewLine("%Datetime% [%LevelName%] [%Channel%] %Message%\n", time.RFC3339)
file.SetFormatter(f)
// push handler
logger.PushHandler(buf)
// add log
logger.Warning("xxx")
// close and write
buf.Close()
}
LLog source code is licensed under the MIT Licence.