Skip to content

Commit 14a3347

Browse files
authored
Merge pull request #4231 from akx/builtin-null-handler
Use built-in `logging.NullHandler`
2 parents 700e26d + 48bd898 commit 14a3347

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

boto3/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# language governing permissions and limitations under the License.
1313

1414
import logging
15+
from logging import NullHandler
1516

1617
from boto3.compat import _warn_deprecated_python
1718
from boto3.session import Session
@@ -101,11 +102,6 @@ def resource(*args, **kwargs):
101102
return _get_default_session().resource(*args, **kwargs)
102103

103104

104-
# Set up logging to ``/dev/null`` like a library is supposed to.
105+
# Set up do-nothing logging like a library is supposed to.
105106
# https://docs.python.org/3.3/howto/logging.html#configuring-logging-for-a-library
106-
class NullHandler(logging.Handler):
107-
def emit(self, record):
108-
pass
109-
110-
111107
logging.getLogger('boto3').addHandler(NullHandler())

0 commit comments

Comments
 (0)