Skip to content
/ liitu Public

A pretty logging library for better readability with slog and zerolog

License

Notifications You must be signed in to change notification settings

lime008/liitu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

liitu

Go Reference Go Report Card

liitu is a pretty logging library for go with focus on readability. It currently implements formatters for github.com/rs/zerolog and log/slog.

liitu == crayon

From a old finnish proverb:

"Ne piirtää kel on liituu"
Translation: "Those who have cryons/chalk will draw"

liitu/slog

Getting started

go get -u github.com/lime008/liitu

Using with slog

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")
}

Using with zerolog

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")
}

References

About

A pretty logging library for better readability with slog and zerolog

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages