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

better abstration for LoggingSystem state #222

Merged
merged 2 commits into from Jun 29, 2022

Conversation

tomerd
Copy link
Member

@tomerd tomerd commented Jun 28, 2022

motivation: prepare for sendable checks (they dont work well with static state)

changes:

  • abstract the LoggingSystem state into a "boxed" class that handles the locking
  • adjust call sites

@tomerd tomerd requested review from ktoso, weissi and yim-lee June 28, 2022 19:46
motivation: prepare for sendable checks

changes:
* abstract the LoggingSystem state into a "boxed" class that handles the locking
* adjust call sites
}

func replaceFactory(_ factory: @escaping (String) -> LogHandler, validate: Bool) {
#if canImport(WASILibc)
Copy link
Member

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?

Copy link
Member Author

@tomerd tomerd Jun 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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?

Copy link
Member Author

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

@tomerd tomerd mentioned this pull request Jun 29, 2022
Copy link
Member

@weissi weissi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tomerd tomerd added the patch-version-bump-only For PRs that when merged will only cause a bump of the patch version, ie. 1.0.x -> 1.0.(x+1) label Jun 29, 2022
@tomerd tomerd merged commit 9f3731a into apple:main Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch-version-bump-only For PRs that when merged will only cause a bump of the patch version, ie. 1.0.x -> 1.0.(x+1)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants