This package supplies a thread-safe logger, a simple logging interface and commonly used logging destinations. Currently supported implementations are
- Text (writes to Stdout/Stderr by default)
- DevNull (does nothing)
- JSON (logs JSON messages to Stdout by default)
- Syslog (logs messages to the local syslog facility)
To use the logging interface do
go get github.com/els0r/log/...
Example on how to use the package in your code
package main
import(
log "github.com/els0r/log"
)
func main() {
l := log.New(WithLevel(log.INFO))
// Do someting
l.Infof("We have done %d things today", 10)
l.Error("This is an error")
}