Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new: Nested objects flattening feature #229

Merged
merged 1 commit into from
May 2, 2024
Merged

new: Nested objects flattening feature #229

merged 1 commit into from
May 2, 2024

Conversation

pamburus
Copy link
Owner

@pamburus pamburus commented May 1, 2024

Added

  • --flatten command line option.
  • HL_FLATTEN environment variable
  • formatting.flatten configuration file option.
--flatten <WHEN>        Whether to flatten objects [env: HL_FLATTEN=] [default: always] [possible values: never, always]

The default value is "always", which means that all nested objects are now flattened by default.

Before

After

Reasoning

It is very difficult to read logs with nested objects because you have to collect a lot of scattered keys to construct a path and understand what the fully qualified key really is.

Opt out

To preserve the old behavior, explicitly specify --flatten never or HL_FLATTEN=never, or set formatting.flatten to never in the configuration file.

Copy link

codecov bot commented May 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 40.72%. Comparing base (377359b) to head (859f0f4).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #229      +/-   ##
==========================================
+ Coverage   33.65%   40.72%   +7.07%     
==========================================
  Files          36       36              
  Lines        5049     5078      +29     
==========================================
+ Hits         1699     2068     +369     
+ Misses       3350     3010     -340     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pamburus pamburus force-pushed the feature/flatten branch 9 times, most recently from 9ffd3d2 to 8b47e0d Compare May 1, 2024 20:04
@pamburus pamburus changed the title new: Object flattening feature new: Nested objects flattening feature May 1, 2024
@pamburus pamburus marked this pull request as ready for review May 1, 2024 23:23
@pamburus pamburus merged commit d587b75 into master May 2, 2024
4 checks passed
@pamburus pamburus deleted the feature/flatten branch May 2, 2024 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant