Macro apollo_router::assert_snapshot_subscriber

source ·
macro_rules! assert_snapshot_subscriber {
    () => { ... };
    ($redactions:tt) => { ... };
    ($level:expr) => { ... };
    ($level:expr, $redactions:tt) => { ... };
}
Expand description

This is a really simple macro to assert a snapshot of the logs. To use it call .with_subscriber(assert_snapshot_subscriber!()) in your test just before calling await. This will assert a snapshot of the logs in pretty yaml format. You can also use subscriber::with_default(assert_snapshot_subscriber!(), || { … }) to assert the logs in non async code.