

def unwatch_log():
    'Replace WatchedFileHandler handlers by FileHandler ones.\n\n    Neutron logging uses WatchedFileHandler handlers but they do not\n    support privileges drop, this method replaces them by FileHandler\n    handlers supporting privileges drop.\n    '
    log_root = logging.getLogger(None).logger
    to_replace = [h for h in log_root.handlers if isinstance(h, handlers.WatchedFileHandler)]
    for handler in to_replace:
        new_handler = std_logging.FileHandler(handler.baseFilename, mode=handler.mode, encoding=handler.encoding)
        log_root.removeHandler(handler)
        log_root.addHandler(new_handler)

dataset/ETHPy150Open openstack/neutron/neutron/agent/linux/daemon.py unwatch_log/original