From e4a06b4543b8b0c14e78eb5f640bc241f1d436b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Ollah?= Date: Wed, 11 Sep 2024 14:17:29 +0200 Subject: [PATCH] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7905640..88985e9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ ![screenshot](https://github.com/MatusOllah/slogcolor/blob/main/screenshot.png) -**slogcolor** is a color handler for `log/slog`. It's output is inspired by XMRig and zerolog. +**slogcolor** is a little, customizable color handler for `log/slog`. It enhances log readability by color-coding log levels and supports flexible formatting options. +It's output is inspired by XMRig and zerolog. ## Basic Usage @@ -21,6 +22,7 @@ import ( ) func main() { + // Configure slog to use slogcolor by default for colored output slog.SetDefault(slog.New(slogcolor.NewHandler(os.Stderr, slogcolor.DefaultOptions))) slog.Info("Initializing") @@ -55,7 +57,7 @@ slog.Info(slogcolor.Prefix("SceneController", "switching scene")) ### Disable colors -Colors are enabled by default but can be disabled using `Options.NoColor`. Particularly useful for automatically enabling colors based on based on the terminal capabilities using e.g. the [`go-isatty`](https://github.com/mattn/go-isatty) package. +Colors are enabled by default but can be disabled using `Options.NoColor`. Particularly useful for automatically enabling colors based on the terminal capabilities using e.g. the [`go-isatty`](https://github.com/mattn/go-isatty) package. ```go w := os.Stderr