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

run initLogging unconditionally #1295

Closed
wants to merge 1 commit into from
Closed

Conversation

kba
Copy link
Member

@kba kba commented Nov 20, 2024

As discussed in the Tech Call today, we do still need to call initLogging to prevent other modules from adding handlers that might interfere with STDOUT.

And the tests/cli/test_log.py needs to call disableLogging before the first initLogging because otherwise pytest will highjack the logging :/

@kba kba requested a review from bertsky November 20, 2024 16:12
# matplotlib ...) from adding their own root handler, which might mangle the
# STDOUT (our logging will log to STDERR so as not to interfere with
# --dump-json etc.)
initLogging()
Copy link
Collaborator

Choose a reason for hiding this comment

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

No, that's not what I meant. See #1223 (comment)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Alternatively, we could still do initLogging on the module level, though not in ocrd_utils.logging but rather ocrd.decorators, which arguably will only be imported by applications that do need log handlers.

@kba kba closed this Nov 21, 2024
@kba kba deleted the unconditional-initLogging branch November 21, 2024 12:04
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