def configureLogger(logger, log_file, log_level, console_ouput=True):
    # create RotatingFileHandler and set level to debug
    global root_logger
    root_logger = logger
    if (log_file is not None):
        print("log_file=%s" % (log_file))
        if useRotatingFileHandler:
            fh = RFHandler(filename=log_file, mode='a', maxBytes=10 * 1024 * 1024, backupCount=10, encoding='utf-8')
        else:
            fh = TimedRotatingFileHandler(filename=log_file, when='midnight', interval=1, backupCount=10, encoding='utf-8')

        formatter = logging.Formatter(fmt='%(asctime)s,pid=%(process)d,tid=%(thread)d,%(name)s,%(levelname)s:%(message)s')
        fh.setFormatter(formatter)
        logger.addHandler(fh)
        logger.setLevel(log_level)

    # create consoleHanlder
    if (console_ouput):
        ch = logging.StreamHandler()
        shortFormatter = logging.Formatter(fmt='%(asctime)s,pid=%(process)d,tid=%(thread)d,%(name)s,%(levelname)s:%(message)s', datefmt="%H:%M:%S")
        ch.setFormatter(shortFormatter)
        logger.addHandler(ch)
        logger.setLevel(log_level)

    # catch the uncatched exception
    sys.excepthook = my_excepthook
testing multiple child nodes
dataset/ETHPy150Open harryliu/edwin/edwinAgent/common/my_logging.py/configureLogger--crossover with--dataset/ETHPy150Open abunsen/Paython/tests/test_utils.py/test_multiple_child_nodes