#logging-tracing #assertions #testing-debugging #debugging-logging #async #testing-tools

dev tracing-test

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

6 releases

0.2.5 Jun 2, 2024
0.2.4 Feb 1, 2023
0.2.3 Jul 20, 2022
0.2.2 Jun 3, 2022
0.1.0 Nov 19, 2020

#20 in Testing

Download history 54902/week @ 2024-08-13 56908/week @ 2024-08-20 63747/week @ 2024-08-27 70942/week @ 2024-09-03 62183/week @ 2024-09-10 60850/week @ 2024-09-17 69435/week @ 2024-09-24 76048/week @ 2024-10-01 60919/week @ 2024-10-08 80165/week @ 2024-10-15 78200/week @ 2024-10-22 81880/week @ 2024-10-29 76350/week @ 2024-11-05 103039/week @ 2024-11-12 78481/week @ 2024-11-19 48472/week @ 2024-11-26

321,794 downloads per month
Used in 292 crates (247 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

~4.5–6.5MB
~107K SLoC