A zero-dependency slog.Handler that writes colorized logs to the terminal with customizable output.
tint is a Go package that implements a `slog.Handler` for producing colorized log output in terminal environments. It solves the problem of bland, hard-to-read logs by adding tinted formatting to structured logs, making debugging and monitoring more intuitive. The package is designed as a drop-in replacement for the standard `slog.TextHandler` with zero dependencies.
Go developers using the standard library's `log/slog` package who want enhanced, colorized log output for better readability during development and debugging.
Developers choose tint for its simplicity, zero-dependency design, and easy integration—it provides immediate visual improvements to logs without complicating the codebase or adding external dependencies.
🌈 slog.Handler that writes tinted (colorized) logs
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
tint has no external dependencies, keeping Go applications lightweight and avoiding version conflicts, as highlighted in the README's Key Features section.
Through Options, developers can tailor log levels, time formats, and color behavior, with README examples showing attribute manipulation via ReplaceAttr for fine-grained control.
It acts as a drop-in replacement for slog.TextHandler, making integration into existing Go applications straightforward without altering core logging logic.
With automatic color detection and compatibility via packages like go-colorable for Windows, tint ensures colored logs work reliably across different terminal environments.
tint only produces colorized text for terminals, lacking built-in support for JSON or other structured formats required for machine parsing in production logging.
While tint itself is zero-dependency, enabling features like Windows color support or terminal detection requires importing third-party packages, adding complexity and potential dependency management issues.
Using ReplaceAttr for advanced attribute manipulation can lead to verbose and error-prone code, as seen in README examples for custom levels or error coloring, which may deter quick adoption.