syyongx / llog

LLog - Monolog implementation in Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LLog

GoDoc Go Report Card MIT licensed

LLog - Monolog implementation in Go.

GoDoc

Download & Installs

go get github.com/syyongx/llog

Usage

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()
}

LICENSE

LLog source code is licensed under the MIT Licence.

About

LLog - Monolog implementation in Go.

License:MIT License


Languages

Language:Go 100.0%