#async #tracing #testing-tools #test #macro #assert

macro dev tracing-test-macro

A procedural macro that allow for easier testing of crates that use tracing. Internal crate, should only be used through the tracing-test crate

4 releases

0.2.3 Jul 20, 2022
0.2.2 Jun 3, 2022
0.2.1 Nov 23, 2021
0.2.0 Nov 23, 2021
0.1.0 Nov 19, 2020

#269 in Testing

Download history 21679/week @ 2022-10-06 22458/week @ 2022-10-13 22360/week @ 2022-10-20 18241/week @ 2022-10-27 22007/week @ 2022-11-03 19937/week @ 2022-11-10 19918/week @ 2022-11-17 18423/week @ 2022-11-24 18251/week @ 2022-12-01 19056/week @ 2022-12-08 19625/week @ 2022-12-15 11268/week @ 2022-12-22 10880/week @ 2022-12-29 20292/week @ 2023-01-05 20964/week @ 2023-01-12 18837/week @ 2023-01-19

72,886 downloads per month
Used in 69 crates (via tracing-test)

MIT license

7KB
106 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-2022 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

~205–600KB
~14K SLoC