Logger name should be the module name

This commit is contained in:
Andrew Melton 2013-08-01 11:50:25 -04:00
parent 0d3a8be1de
commit 6ee0adb776
2 changed files with 2 additions and 2 deletions
stacktach
tests/unit

@ -98,7 +98,7 @@ def _configure(logger, name):
class ExchangeLogger():
def __init__(self, exchange, name='stacktach-default'):
self.logger = logging.getLogger(name)
self.logger = logging.getLogger(__name__)
_configure(self.logger, name)
self.exchange = exchange

@ -40,7 +40,7 @@ class ExchangeLoggerTestCase(TestCase):
def _setup_logger_mocks(self, name='name'):
mock_logger = self.mox.CreateMockAnything()
self.mox.StubOutWithMock(logging, 'getLogger')
logging.getLogger(name).AndReturn(mock_logger)
logging.getLogger(stacklog.__name__).AndReturn(mock_logger)
mock_logger.setLevel(logging.DEBUG)
self.mox.StubOutClassWithMocks(logging.handlers,
'TimedRotatingFileHandler')