chideat / glog

golang log

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

glog

This is a log package for golang. This package is based on offical log pkg.

Usage

import "glog"

Log Level and Log Format

This package supports three log levels:

  • INFO
2016/03/25 14:42:00 [INFO] /Users/chideat/Projects/go/src/test/main.go:8 this is info
  • WARN
2016/03/25 14:42:00 [WARN] /Users/chideat/Projects/go/src/test/main.go:8 this is warn
  • ERROR
2016/03/25 14:42:00 [ERROR] /Users/chideat/Projects/go/src/test/main.go:8 this is error

Modifiy the log level at runtime

SetLevel(INFO|WARN|ERROR)

Debug Model

In this model, all log info is output to stdout.

Examples:

SetDebug(true)

About

golang log


Languages

Language:Go 100.0%