Initial commit
16 files changed
tree: a047f888fdd7a3d6ddc04dec830856064383fa03
  1. examples/
  2. backend.go
  3. init.go
  4. level.go
  5. level_test.go
  6. LICENSE
  7. log.go
  8. log_test.go
  9. logger.go
  10. logger_test.go
  11. memory.go
  12. memory_test.go
  13. multi.go
  14. multi_test.go
  15. README.md
  16. syslog.go
README.md

Golang logging library

Package logging implements a logging infrastructure for Go. It supports different logging backends like syslog, file and memory. Multiple backends can be utilized with different log levels per backend and logger.

Installing

Using go get

$ go get github.com/op/gologging

After this command gologging is ready to use. Its source will be in:

$GOROOT/src/pkg/github.com/op/gologging

You can use go get -u -a to update all installed packages.

Example

package main

import "github.com/op/gologging"

var log = logging.MustGetLogger("package.example")

func main() {
	logging.SetLevel(logging.INFO, "package.example")
	log.Debug("hello %s", "golang")
	log.Info("hello %s", "golang")
}

Documentation

Examples are found in examples/. For docs, see http://godoc.org/github.com/op/gologging or run:

$ go doc github.com/op/gologging