enabled built-in go error formatting instead of requriring tintErr wrapping, colorized debug level text to increase readability #67
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank you this nice package, since moving to slog I was missing the pretty zerolog-like output. Until I discovered tint :)!
PR summary:
bugfix/feature [45f85b4]: without resorting to the package provided
tintErr
error type wrapper, users using the native slog API to log errors didn't get colorized/red output for error messages.By asserting the built-in
error
interface directly, both the tintErr and any other errors (satisfying theerror
interface) get the colorization treatment, also regardless of the key provided for the error value.This kinda makes the whole
tintError
type obsolete (and I would recommend removing it altogether eventually), but I left it in for backwards compatibility in case users of this package calledtint.Err(err)
in their business logic or own package wrappers. Using the native slog API is certainly more portable, as one doesn't need to provide a wrapper package for slog and/or tint in that case.Preview:
feature [3fbd1c2]: added faint magenta as a foreground color for debug messages, to visually isolate the DBG level text better from the log message text that follows -> increases readability when glancing over output and increases 🌈 level
Preview: