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

Rework logging and fix overwritten config #553

Merged
merged 2 commits into from
Jul 4, 2024

Conversation

MaxDall
Copy link
Collaborator

@MaxDall MaxDall commented Jul 3, 2024

Fixes a bug when using spawn as start method for multiprocessing

Previously, when using spawn as a start method, already set logging configurations are overwritten, when starting a new process. This PR introduces a workaround, passing the current configuration to the Pool and initializing the logging module with said config when a new process is started for the CCNewsCrawler.

Reworks parts of the logging module

IMO adding handlers and setting levels was still pretty tedious, even after the last rework. With this PR, the logger debug level is set to DEBUG by default, and one controls debugging with handler levels instead of the logger level.

@MaxDall MaxDall requested a review from addie9800 July 3, 2024 16:25
Copy link
Collaborator

@addie9800 addie9800 left a comment

Choose a reason for hiding this comment

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

Thanks for the rework 👍

src/fundus/logging.py Outdated Show resolved Hide resolved
@MaxDall MaxDall merged commit 07b9c14 into master Jul 4, 2024
4 checks passed
@MaxDall MaxDall deleted the fix-logging-for-start-method-spawn branch July 4, 2024 18:14
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

Successfully merging this pull request may close these issues.

2 participants