diff options
author | John L. Villalovos <john@sodarock.com> | 2022-10-03 21:29:54 -0700 |
---|---|---|
committer | Nejc Habjan <nejc.habjan@siemens.com> | 2023-03-12 20:23:40 +0100 |
commit | b476afe9928c6e844b86b56f9316ae1a1fe254f2 (patch) | |
tree | 8aa4e2743dacd661365d04bdfedf8477626d6fce /gitlab/__init__.py | |
parent | 7a8a86278543a1419d07dd022196e4cb3db12d31 (diff) | |
download | gitlab-jlvillal/logging.tar.gz |
chore: add bare-minimum logging supportjlvillal/logging
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
Diffstat (limited to 'gitlab/__init__.py')
-rw-r--r-- | gitlab/__init__.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py index e7aafda..889a52c 100644 --- a/gitlab/__init__.py +++ b/gitlab/__init__.py @@ -19,6 +19,7 @@ import warnings from typing import Any +import gitlab._logging import gitlab.config # noqa: F401 from gitlab import utils as _utils from gitlab._version import ( # noqa: F401 |