def modify_logging(input_fn, output_fn, min_level_value, max_level_value, restore, force):
<EOL>logging.info('<STR_LIT>' % input_fn)<EOL>fh = open(input_fn, '<STR_LIT:r>')<EOL>lines = fh.readlines()<EOL>fh.close()<EOL>original_contents = '<STR_LIT>'.join(lines)<EOL>if restore:<EOL><INDENT>forwards = restore_logging<EOL>backwards = disable_logging<EOL><DEDENT>else:<EOL><INDENT>forwards = disable_logging<EOL>backwards = restore_logging<EOL><DEDENT>new_contents = forwards(lines, min_level_value, max_level_value)<EOL>logging.disable(logging.CRITICAL)<EOL>new_contents_undone = backwards(new_contents.splitlines(True), min_level_value, max_level_value)<EOL>logging.disable(logging.DEBUG)<EOL>if original_contents != new_contents_undone:<EOL><INDENT>base_str = '<STR_LIT>'<EOL>if force:<EOL><INDENT>logging.warning(base_str + "<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>logging.error(base_str + '<STR_LIT>')<EOL>return -<NUM_LIT:1><EOL><DEDENT><DEDENT>logging.info('<STR_LIT>' % output_fn)<EOL>fh = open(output_fn, '<STR_LIT:w>')<EOL>fh.write(new_contents)<EOL>fh.close()<EOL>logging.info('<STR_LIT>')<EOL>return <NUM_LIT:0><EOL>
Modifies logging statements in the specified file.