Skip to content

landonia/golog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

golog

Go Report Card GoDoc

A wrapper for the go log providing namespaces and standard levels

Overview

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.

Installation

With a healthy Go Language installed, simply run go get github.com/landonia/golog

Example

  	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")
	}

Out of Box Example

simply run go run $GOPATH/src/github.com/landonia/golog/cmd/example.go

You should see output to the following:

Example output

About

golog was written by Landon Wainwright | GitHub.

Follow me on Twitter @landotube! Although I don't really tweet much tbh.

About

A simple log that will print using colours to a specific stream

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages