#logging-tracing #assertions #assertion #logger #logs #logged

dev tracing-test

Helper functions and macros that allow for easier testing of crates that use tracing

5 releases

0.2.4 Feb 1, 2023
0.2.3 Jul 20, 2022
0.2.2 Jun 3, 2022
0.2.1 Nov 23, 2021
0.1.0 Nov 19, 2020

#24 in Testing

Download history 33910/week @ 2023-11-20 37312/week @ 2023-11-27 35241/week @ 2023-12-04 33828/week @ 2023-12-11 30725/week @ 2023-12-18 17619/week @ 2023-12-25 28889/week @ 2024-01-01 36519/week @ 2024-01-08 38007/week @ 2024-01-15 41357/week @ 2024-01-22 42627/week @ 2024-01-29 42436/week @ 2024-02-05 37635/week @ 2024-02-12 37384/week @ 2024-02-19 43544/week @ 2024-02-26 42972/week @ 2024-03-04

163,784 downloads per month
Used in 173 crates (157 directly)

MIT license

15KB
86 lines

tracing-test

Build status Crates.io Version Crates.io Downloads

This crate provides an easy way to enable logging in tests that use tracing, even if they're async. Additionally, it adds a way to assert that certain things were logged.

The focus is on testing the logging, not on debugging the tests. That's why the library ensures that the logs do not depend on external state. For example, the RUST_LOG env variable is not used for log filtering.

Similar crates:

Docs / Usage / Example

See https://docs.rs/tracing-test/.

License

Copyright © 2020-2023 Threema GmbH, Danilo Bargen and Contributors.

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~7.5MB
~133K SLoC