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

Jazzy overrides the 'logging' class attributes instead of creating an instance of a logger #339

Closed
ghiander opened this issue Nov 1, 2023 · 0 comments
Assignees

Comments

@ghiander
Copy link
Collaborator

ghiander commented Nov 1, 2023

Describe the bug
Jazzy imports logging as a module and changes the formatting of the class attributes instead of creating an instance and changing its attributes - this means that when jazzy is imported by, for example a app (say main.py) that integrates it, Jazzy overrides the global logging attributes, and even the logs of the app will be printed using the formatting adopted by jazzy.

This issue is caused by the command in jazzy/core.py
logging.basicConfig( format="Jazzy %(levelname)s: [%(asctime)s] %(message)s", level=logging.WARNING, datefmt="%H:%M:%S", )

To Reproduce
Steps to reproduce the behavior:
TODO... This was observed in proprietary code

Expected behavior
Only Jazzy logs should be formatted as Jazzy %(levelname)s: [%(asctime)s] %(message)s. Using an instance instead of the module to log messages out will fix the problem.

@ghiander ghiander self-assigned this Nov 1, 2023
f3rmion pushed a commit that referenced this issue Mar 19, 2024
* issue #339: implemented instance-specific logging formatting

* NegativeLonePairsError exception;  JazzyError exception handler for API; migrated utils.py into exception.py
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