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

Use loguru for logging #13

Open
TaiSakuma opened this issue Oct 20, 2023 · 0 comments
Open

Use loguru for logging #13

TaiSakuma opened this issue Oct 20, 2023 · 0 comments

Comments

@TaiSakuma
Copy link
Member

I tried to switch from the Python standard logging to loguru. But I will need to do more work to complete it. I am working on the branch loguru.

The loguru readme shows how to send logging messages to loguru sinks. In nextline, this method doesn't correctly show the location of logging messages created in spawned processes. The locations all become nextline.utils.multiprocessing_logging:95, which is where nextline collects logging messages created in spawned processes.

loguru doesn't read the locations from the log records. It determines the locations from the frames in the main process.

On the other hand, loguru does support multiprocessing.. But it doesn't collect logging messages in the main process. It processes logging messages in each sub-process.

Consequently, to use loguru in nextline, we need to disable MultiprocessingLogging and use InterceptHandler in each spawned process.

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

No branches or pull requests

1 participant