All Projects → soundcloud → Logorithm

soundcloud / Logorithm

SoundCloud logging for Go

Programming Languages

go
31211 projects - #10 most used programming language

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].