def createTreeLogger(name, level=logging.DEBUG):
    logger = logging.getLogger(name)
logger.setLevel(level)
ch = logging.StreamHandler()
ch.setLevel(level)
ch.setFormatter(TreeFormatter())
logger.addHandler(ch)
return logger
if __name__ == '__main__':
    logger_a = createTreeLogger('a')
logger_a_b = logging.getLogger('a.b')
logger_a_b_c = logging.getLogger('a.b.c')
logger_a.debug('One')
logger_a_b.warning('two')
logger_a_b.warning('three')
logger_a_b_c.critical('Four')
logger_a_b.warning('Five')
logger_a.warning('Six')
Форматировать сообщения журнала в виде дерева