logmania/examples/with/main.go

22 lines
594 B
Go
Raw Normal View History

2017-06-11 03:34:11 +02:00
package main
import (
"time"
"github.com/genofire/logmania/log"
logClient "github.com/genofire/logmania/log/hook/client"
logOutput "github.com/genofire/logmania/log/hook/output"
)
func main() {
2017-06-12 22:32:27 +02:00
logClient.Init("ws://localhost:8081", "example", log.DebugLevel)
2017-06-11 03:34:11 +02:00
log.Info("startup")
log.New().AddField("answer", 42).AddFields(map[string]interface{}{"answer": 3, "foo": "bar"}).Warn("Some spezial")
log.Debug("Never shown up")
logOutput.ShowTime = false
logOutput.AboveLevel = log.DebugLevel
log.Debugf("Startup %v", time.Now())
logOutput.ShowTime = true
log.Panic("let it crash")
}