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

Codable Logger.Level #99

Merged
merged 1 commit into from
Sep 26, 2019
Merged

Codable Logger.Level #99

merged 1 commit into from
Sep 26, 2019

Conversation

JulianKahnert
Copy link
Contributor

Add codable to Logger.Level for simple Encoding and Decoding.

Motivation:

Logs may be sent to as json to a REST endpoint. To create a simple serialization, Logger.Level could implement Codable.

Modifications:

Made Logger.Level adopt Codable.

Result:

Easy encoding and decoding of e.g. a struct that has a Logger.Level property.

@swift-server-bot
Copy link

Can one of the admins verify this patch?

2 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?

@weissi
Copy link
Member

weissi commented Sep 26, 2019

@swift-server-bot test this please

@weissi
Copy link
Member

weissi commented Sep 26, 2019

I'm happy with this!

Copy link
Member

@weissi weissi left a comment

Choose a reason for hiding this comment

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

Thank you @JulianKahnert ! That looks good to me. I'll give @tomerd / @ktoso / @ianpartridge a chance to comment before merging.

@ianpartridge
Copy link
Contributor

+1

@ktoso
Copy link
Member

ktoso commented Sep 26, 2019

LGTM, was iffy about the : String part but that’s fine since ordering we have expressed thanks to the internal ‘ naturalIntegralValue’ — seems fine then. :-)

@ktoso
Copy link
Member

ktoso commented Sep 26, 2019

Was thinking yet a bit more what if we want to send those around in a binary format... but then I could write my own codable for the outer type and handle the enum whichever way I want... so it’s all fine I think. Thanks!

@JulianKahnert
Copy link
Contributor Author

JulianKahnert commented Sep 26, 2019

Hi @weissi @ianpartridge @ktoso , thanks for all your super fast feedback! 🙂 ... so can we merge it?

... sry don‘t want to skip @tomerd !

@weissi weissi merged commit 77b2e83 into apple:master Sep 26, 2019
@weissi weissi added the 🆕 semver/minor Adds new public API. label Sep 26, 2019
@JulianKahnert
Copy link
Contributor Author

Hi @weissi, is it possible to create a new release with this PR included? I want to use this changes, but this is currently not possible.

rynecheow pushed a commit to ntuc-social-enterprises/swift-log that referenced this pull request Nov 4, 2019
@weissi
Copy link
Member

weissi commented Nov 4, 2019

@JulianKahnert sorry about that, 1.2.0 is released now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 semver/minor Adds new public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants