wangliangl / log

base on zap, an easy using logger module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

log

base on zap, an easy using logger module

package main

import "github.com/georgehao/log"

func main() {
	// init log
	// set absolute path, and level
	// set output level
	// don't need request log
	// set log's caller using logOption
	log.Init("./test.log", log.DebugLevel, false, log.SetCaller(true))
	log.Info("hello george log")
	// flush
	log.Sync()
	//output: {"level":"info","ts":"2019-12-16T10:37:11.364+0800","caller":"example/example.go:12","msg":"hello george log"}
}

About

base on zap, an easy using logger module

License:Apache License 2.0


Languages

Language:Go 100.0%