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
[HOLD] Remove Logger.Level
numeric values while still supporting Comparable
conformance
#33
Conversation
Can one of the admins verify this patch? |
@@ -392,8 +400,21 @@ extension Logger { | |||
} | |||
|
|||
extension Logger.Level: Comparable { | |||
private var severityOrdering: Int { | |||
switch self { | |||
case .debug: return 0 |
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.
So I was very worried about the code-size that this will generate but the Swift compiler is really smart and as long as the order of the cases is aligned with the numbers, this works really well as the compiler can see through 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.
@@ -392,8 +400,21 @@ extension Logger { | |||
} | |||
|
|||
extension Logger.Level: Comparable { | |||
private var severityOrdering: Int { |
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.
this will need to become @inlinable
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.
Does it? Or just @usableFromInline var ...
?
I am probably misunderstanding what the compiler can and can't do - but I assume that the protocol conformance methods are not inlinable, but code within it would be?
Logger.Level
numeric values while still supporting Comparable
conformanceLogger.Level
numeric values while still supporting Comparable
conformance
thanks! I'm happy with this but we should sit on this until the discussion on the forums concludes if this is a good idea or not. |
Definitely agree! Just wanted to help contribute where I had free time and to have something concrete to discuss |
Closed in favor of #35 |
No description provided.