log is a simple and useful logging tool of Go. see API.
- light weight
- easy to use
there is only 2 log level(Debug,Info) the philosophy of this can be found in here
go get github.com/imroc/log
import (
"github.com/imroc/log"
)
func main() {
log.Debug("debug ", "message")
log.Infof("%s message", "info")
}
output:
2016/10/04 14:38:38 [DEBG] main.go:7 debug message
2016/10/04 14:38:38 [INFO] main.go:8 info message
log.SetFilename("test.log")
log.SetFlag(log.Ldate | log.Ltime | log.Llongfile)
log.SetDebug(false)
log is is distributed under the terms of the MIT License.