-
Notifications
You must be signed in to change notification settings - Fork 669
Formalize logging #2080
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
Comments
@bachsh I've also wanted to add some logging here for some time, and remove the custom PS: Personally I'd just go with something like https://github.com/Delgan/loguru because I don't like the tedious stdlib logging setup, but this being a library, people won't like more dependencies probably. |
Follow the Python documentation guidelines for "Configuring Logging for a Library" [1] Which is adding these two lines: import logging logging.getLogger(__name__).addHandler(logging.NullHandler()) Setup a very basic usage of logging in `gitlab/client.py` By using the NullHandler it means that by default any log messages output will not be displayed. It is up to the client application to do a `logging.basicConfig()` call to get log messages to display. [1] https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library Related: #2080
Follow the Python documentation guidelines for "Configuring Logging for a Library" [1] Which is basically adding these two lines: import logging logging.getLogger(__name__).addHandler(logging.NullHandler()) Setup a very basic usage of logging in `gitlab/client.py` By using the NullHandler it means that by default any log messages output will not be displayed. It is up to the client application to do a `logging.basicConfig()` call to get log messages to display. [1] https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library Related: #2080
Follow the Python documentation guidelines for "Configuring Logging for a Library" [1] Which is basically adding these two lines: import logging logging.getLogger(__name__).addHandler(logging.NullHandler()) Setup a very basic usage of logging in `gitlab/client.py` By using the NullHandler it means that by default any log messages output will not be displayed. It is up to the client application to do a `logging.basicConfig()` call to get log messages to display. [1] https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library Related: #2080
Follow the Python documentation guidelines for "Configuring Logging for a Library" [1] Which is basically adding these two lines: import logging logging.getLogger(__name__).addHandler(logging.NullHandler()) Setup a very basic usage of logging in `gitlab/client.py` By using the NullHandler it means that by default any log messages output will not be displayed. It is up to the client application to do a `logging.basicConfig()` call to get log messages to display. [1] https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library Related: #2080
Follow the Python documentation guidelines for "Configuring Logging for a Library" [1] Which is basically adding these two lines: import logging logging.getLogger(__name__).addHandler(logging.NullHandler()) Setup a very basic usage of logging in `gitlab/client.py` By using the NullHandler it means that by default any log messages output will not be displayed. It is up to the client application to do a `logging.basicConfig()` call to get log messages to display. [1] https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library Related: #2080
Follow the Python documentation guidelines for "Configuring Logging for a Library" [1] Which is basically adding these two lines: import logging logging.getLogger(__name__).addHandler(logging.NullHandler()) Setup a very basic usage of logging in `gitlab/client.py` By using the NullHandler it means that by default any log messages output will not be displayed. It is up to the client application to do a `logging.basicConfig()` call to get log messages to display. [1] https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library Related: #2080
Follow the Python documentation guidelines for "Configuring Logging for a Library" [1] Which is basically adding these two lines: import logging logging.getLogger(__name__).addHandler(logging.NullHandler()) Setup a very basic usage of logging in `gitlab/client.py` By using the NullHandler it means that by default any log messages output will not be displayed. It is up to the client application to do a `logging.basicConfig()` call to get log messages to display. [1] https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library Related: #2080
Follow the Python documentation guidelines for "Configuring Logging for a Library" [1] Which is basically adding these two lines: import logging logging.getLogger(__name__).addHandler(logging.NullHandler()) Setup a very basic usage of logging in `gitlab/client.py` By using the NullHandler it means that by default any log messages output will not be displayed. It is up to the client application to do a `logging.basicConfig()` call to get log messages to display. [1] https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library Related: #2080
Follow the Python documentation guidelines for "Configuring Logging for a Library" [1] Which is basically adding these two lines: import logging logging.getLogger(__name__).addHandler(logging.NullHandler()) Setup a very basic usage of logging in `gitlab/client.py` By using the NullHandler it means that by default any log messages output will not be displayed. It is up to the client application to do a `logging.basicConfig()` call to get log messages to display. [1] https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library Related: #2080
In addition to that change, I think it makes sense to log (in DEBUG level) that a rate limit 429 has occurred, but IDK how the maintainers would like to add logging here, if at all. If anyone agrees with me on this I'd love to have guidance on how to add this logging.
Originally posted by @bachsh in #2074 (comment)
The text was updated successfully, but these errors were encountered: