canhlinh / log4go

Log for golang, goji, gorm.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Log for golang, goji, gorm.


Languages

Language:Go 100.0%