charmbracelet / log

A minimal, colorful Go logging library 🪵
MIT License
2.4k stars 67 forks source link

fix: support custom slog levels #117

Closed lvlcn-t closed 7 months ago

lvlcn-t commented 7 months ago

Motivation

Closes #116

Changes

I've removed the fromSlogLevel map and type casting to int32/Level instead.

For more information look at the commits.

Tests done

I've provided two unit tests with custom slog levels. If you want me to write additional test cases, feel free to ask for them.

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 80.48%. Comparing base (2338a13) to head (5e028ac). Report is 13 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #117 +/- ## ========================================== - Coverage 80.92% 80.48% -0.44% ========================================== Files 11 11 Lines 739 656 -83 ========================================== - Hits 598 528 -70 + Misses 126 112 -14 - Partials 15 16 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

aymanbagabas commented 7 months ago

Thank you @lvlcn-t!