repositorypackage
0.0.0-20171123040613-fb8d218825e0
Repository: https://github.com/canhlinh/log4go.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
# README
Log for golang, goji log, gorm log, echo log
Installation:
go get github.com/canhlinh/log4go
Usage:
- Add the following import:
import log "github.com/canhlinh/log4go"
Example
package main
import (
"time"
)
import log "github.com/canhlinh/log4go"
func main() {
defer log.Close()
log.AddFilter("stdout", log.DEBUG, log.NewConsoleLogWriter())
log.Info("The time is now: %s", time.Now().Format("15:04:05 MST 2006/01/02"))
log.Debug("The time is now: %s", time.Now().Format("15:04:05 MST 2006/01/02"))
log.Warn("The time is now: %s", time.Now().Format("15:04:05 MST 2006/01/02"))
log.Error("The time is now: %s", time.Now().Format("15:04:05 MST 2006/01/02"))
log.Trace("The time is now: %s", time.Now().Format("15:04:05 MST 2006/01/02"))
}