Skip to content

Fix up multiprocessing logging #108

@znichollscr

Description

@znichollscr

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureRelated to a (new) feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions