def setup_prefix_logging(logdir):
    """
    Sets up a file logger that will create a log in the given logdir (usually a
    lago prefix)

    Args:
        logdir (str): path to create the log into, will be created if it does
            not exist

    Returns:
        None
    """
    if not os.path.exists(logdir):
        os.mkdir(logdir)

    file_handler = logging.FileHandler(
        filename=os.path.join(logdir, 'lago.log'),
    )
    file_formatter = get_default_log_formatter()
    file_handler.setFormatter(file_formatter)
    logging.root.addHandler(file_handler)
    hide_paramiko_logs()
    hide_stevedore_logs()
def setup_prefix_logging ( logdir ) : if not os . path . exists ( logdir ) : os . mkdir ( logdir ) file_handler = logging . FileHandler ( filename = os . path . join ( logdir , 'lago.log' ) , ) file_formatter = get_default_log_formatter ( ) file_handler . setFormatter ( file_formatter ) logging . root . addHandler ( file_handler ) hide_paramiko_logs ( ) hide_stevedore_logs ( )
Sets up a file logger that will create a log in the given logdir (usually a
    lago prefix)

    Args:
        logdir (str): path to create the log into, will be created if it does
            not exist

    Returns:
        None