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

Fix up multiprocessing logging #108

Open
3 tasks
znichollscr opened this issue Dec 23, 2024 · 0 comments
Open
3 tasks

Fix up multiprocessing logging #108

znichollscr opened this issue Dec 23, 2024 · 0 comments
Labels
feature Related to a (new) feature

Comments

@znichollscr
Copy link
Contributor

znichollscr commented Dec 23, 2024

The problem

It turns out that logging with multiprocessing is non-trivial if you're using processes rather than threads.

Definition of "done"

Additional context

Looking at the loguru tests, e.g. https://github.com/znichollscr/loguru/blob/61963240dece1979961ec43840e06a1f396479c4/tests/test_multiprocessing.py#L449 and https://github.com/znichollscr/loguru/blob/61963240dece1979961ec43840e06a1f396479c4/tests/test_multiprocessing.py#L476, it seems like the only way to support this on windows is to use spawn multiprocessing (windows doesn't support forking). I think that also means that we would need to support passing the logger in as an (optional) argument all over our API. That would be ok, but is definitely not ideal.

If we can see a different solution, that would be great. It might also be fine to just not support proper parallel logging on windows (this tool will mainly be used on linux systems anyway).

@znichollscr znichollscr added the feature Related to a (new) feature label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Related to a (new) feature
Projects
None yet
Development

No branches or pull requests

1 participant