|
|
||
|---|---|---|
| journslog | ||
| testsink | ||
| LICENSE | ||
| README.md | ||
| attr.go | ||
| attr_key.go | ||
| attr_key_test.go | ||
| attr_test.go | ||
| conn.go | ||
| conn_test.go | ||
| global.go | ||
| go.mod | ||
| priority.go | ||
| wire_proto.go | ||
| wire_proto_test.go | ||
README.md
journal
Native Go output to the systemd journal socket.
See package journslog for a log/slog adapter.
Quick start:
import "src.lwithers.me.uk/go/journal"
func main() {
journal.Entry(journal.PriInfo, "hello, world", nil)
}
The log/slog adapter:
import (
"log/slog"
"src.lwithers.me.uk/go/journal/journslog"
)
func main() {
h, err := journslog.NewHandler()
if err != nil {
panic(err)
}
slog.SetDefault(slog.New(h))
slog.Info("hello, world", "attr", "value")
}