def clear_handlers(self):
root = logging.getLogger()<EOL>for logger in list(root.manager.loggerDict.values()) + [root]:<EOL><INDENT>if hasattr(logger, '<STR_LIT>'):<EOL><INDENT>handlers = logger.handlers<EOL>for handler in handlers:<EOL><INDENT>if hasattr(handler, '<STR_LIT>'):<EOL><INDENT>handler.flush()<EOL><DEDENT>if hasattr(handler, '<STR_LIT>'):<EOL><INDENT>handler.close()<EOL><DEDENT><DEDENT>logger.handlers = []<EOL><DEDENT><DEDENT>sys.stdout = sys.__stdout__<EOL>sys.stderr = sys.__stderr__<EOL>
Deletes all handlers and closes all log-files