def METHOD_NAME(sentry_init, capture_events):
    sentry_init(integrations=[LoggingIntegration()], default_integrations=False)
    events = capture_events()
    logger.setLevel(logging.WARNING)
    logger.error("hi")
    (event,) = events
    assert event["level"] == "error"
    assert event["logentry"]["message"] == "hi"
    del events[:]
    logger.setLevel(logging.ERROR)
    logger.warning("hi")
    assert not events