Skip to content

Weeshlow/plog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plog

Godoc Build Status Go Report Card

A pretty logger for Go

Dependencies

Requires the Go programming language binaries with the GOPATH environment variable specified and $GOPATH/bin in your PATH.

Installation

Using go get:

If your project does not use the vendoring tool Glide to manage dependencies, you can install this package like you would any other:

go get github.com/unchartedsoftware/plog

While this is the simplest way to install the package, due to how go get resolves transitive dependencies it may result in version incompatibilities.

Using glide get:

This is the recommended way to install the package and ensures all transitive dependencies are resolved to their compatible versions.

glide get github.com/unchartedsoftware/plog

NOTE: Requires Glide along with Go version 1.6+.

Example

package main

import (
	"github.com/unchartedsoftware/plog"
)

func main() {
	log.Debug("This is a debug level log")
	log.Info("This", "is", "an", "info", "level", "log")
	log.Warnf("This is a %s level log", "warn")
	log.Error("This is an error level log")

	// only log warnings and errors
	log.SetLevel(log.WarnLevel)

	log.Debug("This is a debug level log, I will be ignored")
	log.Info("This is an info level log, I will be ignored too")
	log.Warn("This is a warn level log, you will see me")
	log.Error("This is an error level log, you will see me too")
}

About

A pretty logger for Go

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors