-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: use own logger, not global logger #10
Conversation
Feature looks promising. |
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
IC is failing. |
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@kroeschl i think all is settled, |
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
This PR is now a bit more than what I intended to change. Specifically:
I'm inclined to roll this back to just the fix for the issue and let other rework live in a separate PR. |
thanks for looking into this.
From a architectural perspective, it looked obvious to move all log/output to an own logger.
Also, a logger name including variations of "logging" is somewhat redundant. "Python logging convention"? If there is no PEP, then there is no convention, right?
It was needed to prevent circular dependencies ;-)
The mentioned module is nonpublic API. And so the name is nonpublic.
You see that the logger is a global one, so there are possibly multiple "users". |
from .formatters import BaseNameFormatter, CurrentFormatter | ||
from .helpers import BaseHelper | ||
|
||
# !! version is managed by semantic_release | ||
# do not use typing here, or else `semantic_release` might have issues finding the variable | ||
__version__ = '0.12.0' | ||
|
||
logger = logging.getLogger('serializable') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌
bring back logger
and mark it as deprecated.
even though logger
was not used for any logging in the past, it still was public API.
but all UPPERCASE is preferred to point downstream users to the fact, that is a readonly/constant value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or leave as is and consider it a breaking change -- which is okay for a planned v1.0.0
outdated, superseded by #47 |
Description
Instead of calling
logging.debug()
(or similar) directly and causing a call tologging.basicConfig()
, log via our logger only. Also stop manipulating the logging level for our module and let users manage that. Fixes #9.Testing
poetry run tox
succeeds. Also ran the example from the issue and saw no output: