Skip to content

Commit

Permalink
prevent accidental exposure of logging module in apiver modules
Browse files Browse the repository at this point in the history
  • Loading branch information
mjurbanski-reef committed Mar 29, 2024
1 parent 27b8593 commit d06cb16
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions b2sdk/_v3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
from __future__ import annotations

# Set default logging handler to avoid "No handler found" warnings.
import logging
import logging as _logging

logging.getLogger("b2sdk").addHandler(logging.NullHandler())
_logging.getLogger("b2sdk").addHandler(_logging.NullHandler())


class UrllibWarningFilter:
def filter(self, record):
return record.msg != "Connection pool is full, discarding connection: %s"


logging.getLogger('urllib3.connectionpool').addFilter(UrllibWarningFilter())
_logging.getLogger('urllib3.connectionpool').addFilter(UrllibWarningFilter())

# this file maps the external interface into internal interface
# it will come handy if we ever need to move something
Expand Down

0 comments on commit d06cb16

Please sign in to comment.