liitu is a pretty logging library for go with focus on readability. It currently implements formatters for github.com/rs/zerolog
and log/slog
.
From a old finnish proverb:
"Ne piirtää kel on liituu"
Translation: "Those who have cryons/chalk will draw"
go get -u github.com/lime008/liitu
package main
import (
"os"
"github.com/lime008/liitu"
"log/slog"
)
func main() {
logger = slog.New(liitu.NewSlogHandler(os.Stderr, nil))
log.Debug().Msg("hi")
log.Debug().Msg("hello")
}
package main
import (
"os"
"github.com/lime008/liitu"
"github.com/rs/zerolog/log"
)
func main() {
log.Logger = log.Output(liitu.ZerologWriter{Out: os.Stderr})
log.Debug().Msg("hi")
log.Debug().Msg("hello")
}
- zerolog implementation is originally from github.com/UnnoTed/horizontal
- slog implementation referenced from https://github.com/lmittmann/tint