Use named logger instead of root logger (#236)

pull/318/head^2
Serj Sintsov 2019-10-22 21:52:43 +03:00 committed by Pieter Marsman
parent 733ddf7e57
commit cb9cd8ea46
2 changed files with 10 additions and 5 deletions

View File

@ -5,10 +5,13 @@ import six #Python 2+3 compatibility
import logging import logging
logger = logging.getLogger(__name__)
class CorruptDataError(Exception): class CorruptDataError(Exception):
pass pass
## LZWDecoder ## LZWDecoder
## ##
class LZWDecoder(object): class LZWDecoder(object):
@ -90,7 +93,7 @@ class LZWDecoder(object):
# just ignore corrupt data and stop yielding there # just ignore corrupt data and stop yielding there
break break
yield x yield x
logging.debug('nbits=%d, code=%d, output=%r, table=%r' % logger.debug('nbits=%d, code=%d, output=%r, table=%r' %
(self.nbits, code, x, self.table[258:])) (self.nbits, code, x, self.table[258:]))
return return

View File

@ -8,6 +8,8 @@ import nose
import logging import logging
logger = logging.getLogger(__name__)
from pdfminer.psparser import * from pdfminer.psparser import *
## Simplistic Test cases ## Simplistic Test cases
@ -92,13 +94,13 @@ func/a/b{(c)do*}def
def test_1(self): def test_1(self):
tokens = self.get_tokens(self.TESTDATA) tokens = self.get_tokens(self.TESTDATA)
logging.info(tokens) logger.info(tokens)
assert_equal(tokens, self.TOKENS) assert_equal(tokens, self.TOKENS)
return return
def test_2(self): def test_2(self):
objs = self.get_objects(self.TESTDATA) objs = self.get_objects(self.TESTDATA)
logging.info(objs) logger.info(objs)
assert_equal(objs, self.OBJS) assert_equal(objs, self.OBJS)
return return