[go: up one dir, main page]

Skip to content

chai2010/logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Simple level logging package.

package main

import (
	"log"
	"os"
	"runtime"

	"github.com/chai2010/logger"
)

func init() {
	logger.SetLogger(logger.NewStdLogger(os.Stderr, "", "", log.Lshortfile))
}

func main() {
	var logger = logger.GetLogger()

	logger.SetLevel("DEBUG")
	logger.Debug(runtime.Version())
	logger.Info("hello")
}

Output:

hello.go:25: [DEBUG] go1.10
hello.go:26: [INFO] hello

About

Package logger implements a simple level logging package.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages