You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To verify the behavior, below is a unit test to verify the above semantics of the filter.
#[cfg(test)]mod tests {use slog::{error, debug, info,Logger,Level,Drain};usesuper::filter;#[test]fnshould_not_log_info_messages(){let decorator = slog_term::PlainSyncDecorator::new(slog_term::TestStdoutWriter);let drain = slog_term::FullFormat::new(decorator).build().fuse();let filter = filter(drain,Level::Debug).fuse();let logger = Logger::root_typed(filter,o!());// should discardinfo!(logger, "NO: test info");info!(logger, "NO: test info"; "count" => 10);info!(logger, "NO: test error"; "err" => "None");info!(logger, "NO: test error"; "err" => "");debug!(logger, "NO: test debug");// should log to draininfo!(logger, "YES: test error"; "err" => "Panic!");error!(logger, "YES: test error");}}
The output from this test shows several failure cases, i.e. a record that should be filtered was not.
Mar 10 18:58:03.032 INFO NO: test info
Mar 10 18:58:03.033 INFO NO: test info, count: 10
Mar 10 18:58:03.033 INFO NO: test error, err: None
Mar 10 18:58:03.033 INFO NO: test error, err:
Mar 10 18:58:03.033 INFO YES: test error, err: Panic!
Mar 10 18:58:03.033 ERRO YES: test error
@przygienda I thought it'd be better to create a new issue for this, rather than inside an unrelated PR.
The text was updated successfully, but these errors were encountered:
Based on discussion from #16, a new commit has added support for filtering by the absence or presence of keys in a record.
Here's a example filter which builds a filter that should match these semantics:
To verify the behavior, below is a unit test to verify the above semantics of the filter.
The output from this test shows several failure cases, i.e. a record that should be filtered was not.
@przygienda I thought it'd be better to create a new issue for this, rather than inside an unrelated PR.
The text was updated successfully, but these errors were encountered: