charmbracelet / log

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

feat: preserve order when writing json #124

Closed op closed 6 months ago

op commented 6 months ago

This preserves the order of keys when using the JSON formatter.

Fixes #123.

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 86.76471% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 81.34%. Comparing base (2338a13) to head (ec8b7e3). Report is 15 commits behind head on main.

Files Patch % Lines
json.go 86.76% 8 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #124 +/- ## ========================================== + Coverage 80.92% 81.34% +0.42% ========================================== Files 11 11 Lines 739 686 -53 ========================================== - Hits 598 558 -40 + Misses 126 111 -15 - Partials 15 17 +2 ```

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

op commented 6 months ago

@aymanbagabas sure, i believe something like this would handle that: https://github.com/op/charmbracelet-log/commit/634a620a8ce74329142d71d19b3a8d1d7e124873

aymanbagabas commented 6 months ago

@aymanbagabas sure, i believe something like this would handle that: op@634a620

Could you open a new PR for that one?