Skip to content

Make logged metadata a little more readable#201

Merged
gwynne merged 5 commits intomainfrom
better-metadata-logging
May 30, 2024
Merged

Make logged metadata a little more readable#201
gwynne merged 5 commits intomainfrom
better-metadata-logging

Conversation

@gwynne
Copy link
Copy Markdown
Member

@gwynne gwynne commented May 29, 2024

These changes are now available in 4.14.3

We now explicitly suppress excess " characters recursively in logger metadata.

Also bumps the package to a minimum of Swift 5.8 and fixes some warnings.

@gwynne gwynne added the semver-patch When merged, a new patch version release will be generated label May 29, 2024
@gwynne gwynne requested review from 0xTim, MahdiBM and ptoffy May 29, 2024 19:03
Copy link
Copy Markdown

@dimitribouniol dimitribouniol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Comment on lines +83 to +86
var swiftSettings: [SwiftSetting] { [
.enableUpcomingFeature("ForwardTrailingClosures"),
.enableUpcomingFeature("ConciseMagicFile"),
] }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly curiosity, is there a reason we are opting for a computed property here rather than a constant?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it lets me put the settings at the bottom of the file instead of the top (and I must admit it was @MahdiBM who came up with that).

@codecov
Copy link
Copy Markdown

codecov bot commented May 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.35%. Comparing base (7cf58ad) to head (dff2989).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #201      +/-   ##
==========================================
+ Coverage   48.07%   48.35%   +0.28%     
==========================================
  Files          45       45              
  Lines        1762     1764       +2     
==========================================
+ Hits          847      853       +6     
+ Misses        915      911       -4     
Files Coverage Δ
...oleKitTerminal/Terminal/readpassphrase_linux.swift 0.00% <ø> (ø)
.../ConsoleKitTerminal/Utilities/LoggerFragment.swift 80.59% <100.00%> (+0.90%) ⬆️

}

private extension Logger.MetadataValue {
var descriptionWithoutExcessQuotes: String {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😂

@gwynne gwynne merged commit 9f7932f into main May 30, 2024
@gwynne gwynne deleted the better-metadata-logging branch May 30, 2024 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-patch When merged, a new patch version release will be generated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants