'Test that log levels and messages are emitted correctly for
Logger.'

def test_basicLogger(self):

    log = TestLogger()
    for level in LogLevel.iterconstants():
        format = 'This    is    a    {level_name}    message'
        message = format.format(level_name=level.name)
        logMethod = getattr(log, level.name)
        logMethod(format, junk=message, level_name=level.name)
        self.assertEqual(log.emitted['level'], level)
        self.assertEqual(log.emitted['format'], format)
        self.assertEqual(log.emitted['kwargs']['junk'], message)
        self.assertTrue(hasattr(log, 'event'), 'No    event    observed.')
        self.assertEqual(log.event['log_format'], format)
        self.assertEqual(log.event['log_level'], level)
        self.assertEqual(log.event['log_namespace'], __name__)
        self.assertIsNone(log.event['log_source'])
        self.assertEqual(log.event['junk'], message)
        self.assertEqual(formatEvent(log.event), message)
