def _sanitize_rpc(event):
    """Sanitize certain RPC events before logging them."""
    if event['method'] == 'OFP.ADD_IDENTITY':
        event = event.copy()
        event['params'] = event['params'].copy()
        event['params']['privkey'] = '*** ELIDED ***'
    return event