commit | 701e3992ca8942184615f02a4dd0f2be441d4889 | [log] [tgz] |
---|---|---|
author | Örjan Persson <orjan@spotify.com> | Tue Apr 09 04:10:34 2013 |
committer | Örjan Persson <orjan@spotify.com> | Tue Apr 09 04:10:34 2013 |
tree | b2f004b15ba66822b3e0bc563739af17e9f829b4 | |
parent | 0c77a5db085624c574697168eb5afccf4a537702 [diff] |
Properly flush memory backend
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.
$ go get github.com/op/go-logging
After this command go-logging is ready to use. Its source will be in:
$GOROOT/src/pkg/github.com/op/go-logging
You can use go get -u -a
to update all installed packages.
package main
import "github.com/op/go-logging"
var log = logging.MustGetLogger("package.example")
func main() {
logging.SetLevel(logging.INFO, "package.example")
log.Debug("hello %s", "golang")
log.Info("hello %s", "golang")
}
Examples are found in examples/
. For docs, see http://godoc.org/github.com/op/go-logging or run:
$ go doc github.com/op/go-logging