A
andrew cooke
When I use a config file things seem to work (in other projects), but for my current code I hoped to configure logging from Python.
I distilled my problem down to the following test, which does not print anything. Please can someone explain why? I was expecting the module's logger to delegate to root, which has the DEBUG level set.
from logging import DEBUG, root, getLogger
from unittest import TestCase
class LoggingTest(TestCase):
def test_direct(self):
root.setLevel(DEBUG)
getLogger(__name__).debug("hello world")
Thanks,
Andrew
I distilled my problem down to the following test, which does not print anything. Please can someone explain why? I was expecting the module's logger to delegate to root, which has the DEBUG level set.
from logging import DEBUG, root, getLogger
from unittest import TestCase
class LoggingTest(TestCase):
def test_direct(self):
root.setLevel(DEBUG)
getLogger(__name__).debug("hello world")
Thanks,
Andrew