logo는 go언어로 작성된 간단한(Simple) 로깅 라이브러리입니다.
$ go get github.com/truelsy/logo
// example.go
package main
import (
"time"
"github.com/truelsy/logo"
)
func main() {
logo.Init(&logo.Environment{
LogLevel: logo.LEVEL_DEBUG,
LogPath: "/tmp/logo/",
RotateFileSize: 1024 * 10, // 10K
LogKeepTime: time.Hour * 6,
WriteConsole: true,
})
defer logo.Close()
logo.Debug("Debug")
logo.Debugf("Debugf(%v)", 123)
logo.CDebug(logo.FG_GREEN, "CDebug")
logo.CDebugf(logo.FG_LIGHT_GREEN, "CDebugf(%v)", "hello")
logo.Info("Info")
logo.Infof("Infof(%v)", 456)
logo.CInfo(logo.FG_YELLOW, "CInfo")
logo.CInfof(logo.FG_LIGHT_GREEN, "CInfof(%v)", "logo")
logo.Warn("Warn")
logo.Warnf("Warnf(%v)", 789)
logo.Error("Error")
logo.Errorf("Error(%v)", 890)
}Linux:
Windows:
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
MIT license