-
Notifications
You must be signed in to change notification settings - Fork 301
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
Conversation
Can one of the admins verify this patch? |
2 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
@swift-server-bot test this please |
I'm happy with this! |
There was a problem hiding this 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.
+1 |
LGTM, was iffy about the : String part but that’s fine since ordering we have expressed thanks to the internal ‘ naturalIntegralValue’ — seems fine then. :-) |
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! |
Hi @weissi @ianpartridge @ktoso , thanks for all your super fast feedback! 🙂 ... so can we merge it? ... sry don‘t want to skip @tomerd ! |
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. |
@JulianKahnert sorry about that, 1.2.0 is released now. |
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.