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