A wrapper for the go log providing namespaces and standard levels
The standard go log package provides the core writing methods but does not provide any colouring or level functions. This simply provides those features. You can overwrite the standard log on the package level if you require any different settings.
With a healthy Go Language installed, simply run go get github.com/landonia/golog
package main
import (
"flag"
"github.com/landonia/golog/prettylog"
)
func main() {
log, err := prettylog.New(prettylog.WithNameSpace("mynamespace"))
if err != nil {
panic(err)
}
// Setup application.....
log.Info("Application has started successfully..")
// .. something goes wrong
log.Error("Whoops")
}
simply run go run $GOPATH/src/github.com/landonia/golog/cmd/example.go
You should see output to the following:
golog was written by Landon Wainwright | GitHub.
Follow me on Twitter @landotube! Although I don't really tweet much tbh.