Skip to content

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

Open
nejch opened this issue Jun 20, 2022 · 1 comment
Open

Formalize logging #2080

nejch opened this issue Jun 20, 2022 · 1 comment

Comments

@nejch
Copy link
Member

nejch commented Jun 20, 2022

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)

@nejch
Copy link
Member Author

nejch commented Jun 20, 2022

@bachsh I've also wanted to add some logging here for some time, and remove the custom enable_debug() that's been there for ages in favor of using standard logging methods, environment variable to set the log level, etc. Changing that would be the first step IMO.


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.

JohnVillalovos added a commit that referenced this issue Jul 31, 2022
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
JohnVillalovos added a commit that referenced this issue Aug 1, 2022
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
JohnVillalovos added a commit that referenced this issue Aug 1, 2022
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
JohnVillalovos added a commit that referenced this issue Aug 5, 2022
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
JohnVillalovos added a commit that referenced this issue Aug 6, 2022
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
JohnVillalovos added a commit that referenced this issue Aug 25, 2022
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
JohnVillalovos added a commit that referenced this issue Sep 10, 2022
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
JohnVillalovos added a commit that referenced this issue Oct 4, 2022
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
nejch pushed a commit that referenced this issue Mar 12, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant