Skip to content

Latest commit

 

History

History
41 lines (36 loc) · 852 Bytes

README.md

File metadata and controls

41 lines (36 loc) · 852 Bytes

log

log is a simple and useful logging tool of Go. see API.

Features

  • light weight
  • easy to use

Note

there is only 2 log level(Debug,Info) the philosophy of this can be found in here

Quick Start

Installation
go get github.com/imroc/log
Simple Usage
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
More Control
log.SetFilename("test.log")
log.SetFlag(log.Ldate | log.Ltime | log.Llongfile)
log.SetDebug(false)

LICENSE

log is is distributed under the terms of the MIT License.