diff options
author | Leonard Richardson <leonardr@segfault.org> | 2016-07-17 15:14:20 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2016-07-17 15:14:20 -0400 |
commit | 49f78aa54c1cbdd7091ecd930ae2d327fb736aea (patch) | |
tree | 2188b7bd65076d6dc5e64ec5f324640d135d1360 /bs4/dammit.py | |
parent | ddd96837409420b6b9d301a6e6d83674c43d9855 (diff) |
Use a dedicated logger instead of the root logger. [bug=1511661]
Diffstat (limited to 'bs4/dammit.py')
-rw-r--r-- | bs4/dammit.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bs4/dammit.py b/bs4/dammit.py index 9b6e356..cec0809 100644 --- a/bs4/dammit.py +++ b/bs4/dammit.py @@ -347,7 +347,7 @@ class UnicodeDammit: self.tried_encodings = [] self.contains_replacement_characters = False self.is_html = is_html - + self.log = logging.getLogger(__name__) self.detector = EncodingDetector( markup, override_encodings, is_html, exclude_encodings) @@ -377,9 +377,10 @@ class UnicodeDammit: if encoding != "ascii": u = self._convert_from(encoding, "replace") if u is not None: - logging.warning( + self.log.warn( "Some characters could not be decoded, and were " - "replaced with REPLACEMENT CHARACTER.") + "replaced with REPLACEMENT CHARACTER." + ) self.contains_replacement_characters = True break |