SoundCloud logging for Go
Go
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
logorithm.go
logorithm_test.go

README.md

Logorithm

Logorithm is a Go package that provides a custom logger compatible with SoundCloud's logging infrastructure.

Usage

import "github.com/soundcloud/logorithm"
import "os"

...

logger := logorithm.New(os.Stdout, false, "SOFTWARE", "VERSION", "PROGRAM", os.Getpid())

// The following methods are available for each severity level
logger.Emerg("User id: %d", 12345)
logger.Alert("User id: %d", 12345)
logger.Critical("User id: %d", 12345)
logger.Error("User id: %d", 12345)
logger.Warning("User id: %d", 12345)
logger.Notice("User id: %d", 12345)
logger.Info("User id: %d", 12345)
logger.Debug("User id: %d", 12345)

Installing

From the root of the project run:

go install

Testing

go test

Conventions

This repository follows the code conventions dictated by gofmt. To automate the formatting process install this pre-commit hook, which runs gofmt and adds the files. Don't forget to make the file executable: chmod +x .git/hooks/pre-commit.