def log_to_file(filename, level=DEBUG):
logger = logging.getLogger("<STR_LIT>")<EOL>if len(logger.handlers) > <NUM_LIT:0>:<EOL><INDENT>return<EOL><DEDENT>logger.setLevel(level)<EOL>f = open(filename, "<STR_LIT:a>")<EOL>handler = logging.StreamHandler(f)<EOL>frm = "<STR_LIT>"<EOL>frm += "<STR_LIT>"<EOL>handler.setFormatter(logging.Formatter(frm, "<STR_LIT>"))<EOL>logger.addHandler(handler)<EOL>
send paramiko logs to a logfile,
    if they're not already going somewhere