def _create_file_handler(name, testing=False, log_json=False) -> logging.Handler:
    log_dir = dirs.get_log_dir(name)
    global log_file_path
    file_ext = ('.log.json' if log_json else '.log')
    now_str = str(datetime.now().replace(microsecond=0).isoformat()).replace(':', '-')
    log_name = ((((name + '_') + ('testing_' if testing else '')) + now_str) + file_ext)
    log_file_path = os.path.join(log_dir, log_name)
    fh = logging.FileHandler(log_file_path, mode='w')
    if log_json:
        fh.setFormatter(_create_json_formatter())
    else:
        fh.setFormatter(_create_human_formatter())
    return fh
def _create_file_handler(name, testing=False, log_json=False) -> logging.Handler:
    log_dir = dirs.get_log_dir(name)
    global log_file_path
    file_ext = ('.log.json' if log_json else '.log')
    now_str = str(datetime.now().replace(microsecond=0).isoformat()).replace(':', '-')
    log_name = ((((name + '_') + ('testing_' if testing else )) + now_str) + file_ext)
    log_file_path = os.path.join(log_dir, log_name)
    fh = logging.FileHandler(log_file_path, mode='w')
    if log_json:
        fh.setFormatter(_create_json_formatter())
    else:
        fh.setFormatter(_create_human_formatter())
    return fh