Skip to content

Sort metadata by keys when prettifying#151

Merged
ktoso merged 1 commit intoapple:masterfrom
glbrntt:gb-stable-metadata
Sep 3, 2020
Merged

Sort metadata by keys when prettifying#151
ktoso merged 1 commit intoapple:masterfrom
glbrntt:gb-stable-metadata

Conversation

@glbrntt
Copy link
Contributor

@glbrntt glbrntt commented Aug 13, 2020

Motivation:

The stream log handler doesn't print metadata in a stable order. While
swift-log is an API package and shouldn't provide all the bells and
whistles for formatting logs, it should make the default log handler
at least somewhat sensible.

Modifications:

  • Sort the metadata by key when 'prettifying' it

Result:

Motivation:

The stream log handler doesn't print metadata in a stable order. While
swift-log is an API package and shouldn't provide all the bells and
whistles for formatting logs, it should make the default log handler
at least somewhat sensible.

Modifications:

- Sort the metadata by key when 'prettifying' it

Result:

- The stream log handler emits logs with metadata in a stable order
- Resolves apple#128
@swift-server-bot
Copy link

Can one of the admins verify this patch?

4 similar comments
@swift-server-bot
Copy link

Can one of the admins verify this patch?

@swift-server-bot
Copy link

Can one of the admins verify this patch?

@swift-server-bot
Copy link

Can one of the admins verify this patch?

@swift-server-bot
Copy link

Can one of the admins verify this patch?

@ktoso
Copy link
Member

ktoso commented Aug 13, 2020

@swift-server-bot add to whitelist

Copy link
Member

@ktoso ktoso left a comment

Choose a reason for hiding this comment

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

LGTM!

Real world usage warmed us up to doing this in the shipped provided impl, definitely helpful -- thanks again @glbrntt

@ktoso
Copy link
Member

ktoso commented Sep 3, 2020

No reason to wait further, thanks a lot @glbrntt !

@ktoso
Copy link
Member

ktoso commented Sep 3, 2020

Whoops oh no, this was still against master and it seems I forgot to re-target it... will submit against main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Metadata key/value pairs don't maintain order between runs using StreamLogHandler

3 participants