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

JulianKahnert commented Sep 26, 2019

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

This comment has been minimized.

Copy link

swift-server-bot commented Sep 26, 2019

Can one of the admins verify this patch?

2 similar comments
@swift-server-bot

This comment has been minimized.

Copy link

swift-server-bot commented Sep 26, 2019

Can one of the admins verify this patch?

@swift-server-bot

This comment has been minimized.

Copy link

swift-server-bot commented Sep 26, 2019

Can one of the admins verify this patch?

@weissi

This comment has been minimized.

Copy link
Member

weissi commented Sep 26, 2019

@swift-server-bot test this please

@weissi

This comment has been minimized.

Copy link
Member

weissi commented Sep 26, 2019

I'm happy with this!

@weissi
weissi approved these changes Sep 26, 2019
Copy link
Member

weissi left a comment

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

@ianpartridge

This comment has been minimized.

Copy link
Contributor

ianpartridge commented Sep 26, 2019

+1

@ktoso

This comment has been minimized.

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
ktoso approved these changes Sep 26, 2019
@ktoso

This comment has been minimized.

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

This comment has been minimized.

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
2 checks passed
2 checks passed
pull request validation (5.0) Build finished.
Details
pull request validation (5.1) Build finished.
Details
@JulianKahnert

This comment has been minimized.

Copy link
Contributor Author

JulianKahnert commented Nov 2, 2019

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

This comment has been minimized.

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
Projects
None yet
5 participants
You can’t perform that action at this time.