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

[HOLD] Remove Logger.Level numeric values while still supporting Comparable conformance #33

Closed
wants to merge 1 commit into from
Closed

Conversation

Mordil
Copy link

@Mordil Mordil commented Mar 28, 2019

No description provided.

@swift-server-bot
Copy link

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
Copy link
Member

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.

Copy link
Author

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 {
Copy link
Member

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

Copy link
Author

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?

@weissi weissi changed the title Remove Logger.Level numeric values while still supporting Comparable conformance [HOLD] Remove Logger.Level numeric values while still supporting Comparable conformance Mar 28, 2019
@weissi
Copy link
Member

weissi commented Mar 28, 2019

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.

@Mordil
Copy link
Author

Mordil commented Mar 28, 2019

Definitely agree! Just wanted to help contribute where I had free time and to have something concrete to discuss

@Mordil Mordil closed this Apr 5, 2019
@Mordil Mordil deleted the remove-level-values branch April 5, 2019 17:24
@Mordil
Copy link
Author

Mordil commented Apr 5, 2019

Closed in favor of #35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants