Categorygitlab.com/greyxor/slogor
repositorypackage
1.4.1
Repository: https://gitlab.com/greyxor/slogor.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

Slogor - A colorful slog handler

Slogor is a Go package designed to enhance logging capabilities. It provides functionalities for configuring the console mode and defining ANSI color codes, allowing developers to create more visually appealing and informative logs within their applications. With Slogor, users can improve the readability and presentation of their logs, making the debugging and monitoring process more efficient and intuitive.

slogor demo

✨ Features

  • 🚀 Fast and memory efficient
  • 🧑‍💻 Standard logging with slog and close to official TextHandler
  • 🎉 Concurrent/Thread-safe
  • 🌈 ANSI colored with automatic Windows support
  • ✅ Dependency free (except under Windows)
  • ♻️ Customizable writer, logging level and time format
  • 🔧 Debug with the caller path

❓ How to use

slog.SetDefault(slog.New(slogor.NewHandler(os.Stderr, slogor.Options{
    TimeFormat: various.DefaultLoggerTimeFormat,
    Level:      various.DefaultLoggerLevel,
    ShowSource: false,
})))

❓ How to hide time ?

Give an empty time format(TimeFormat) to not display the time

👷 Contributors