log/cmd/simple/main.go

24 lines
364 B
Go

package main
import (
"runtime"
"git.martin-riedl.de/golang/log"
)
func main() {
someMethod()
anotherMethod()
}
func someMethod() {
log.Default.Info("Hello World")
log.Default.With("os", runtime.GOOS).Warning("environment detected")
}
func anotherMethod() {
log.Default.WithMap(log.Map{
"foo": "bar",
"bar": "baz",
}).Info("Second Hello World")
}