-
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
better abstration for LoggingSystem state #222
Conversation
motivation: prepare for sendable checks changes: * abstract the LoggingSystem state into a "boxed" class that handles the locking * adjust call sites
cb36592
to
d2a43ff
Compare
Sources/Logging/Logging.swift
Outdated
} | ||
|
||
func replaceFactory(_ factory: @escaping (String) -> LogHandler, validate: Bool) { | ||
#if canImport(WASILibc) |
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.
shouldn't we push that into the ReaderWriterLock and just do nothing in WASI?
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.
l kept this "as is" based on the comment in L676: https://github.com/apple/swift-log/pull/222/files#diff-f5985f666e1e706d02b520068f87ee07c97e376122fbd685314e088e0d532bb0R676
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.
Yeah, but we can just put the do-nothing code into the ReaderWriterLock
. That has less logic and is already #if
-def'd for Windows etc already, right?
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.
i see, yes that is true
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.
LGTM
motivation: prepare for sendable checks (they dont work well with static state)
changes: