#tracing #logging #procedural #macro #ensure #tracing-test

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

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

#739 in Testing

Download history 18552/week @ 2023-12-23 28159/week @ 2023-12-30 36177/week @ 2024-01-06 37367/week @ 2024-01-13 41077/week @ 2024-01-20 41652/week @ 2024-01-27 41497/week @ 2024-02-03 38705/week @ 2024-02-10 37877/week @ 2024-02-17 43181/week @ 2024-02-24 42991/week @ 2024-03-02 37429/week @ 2024-03-09 43520/week @ 2024-03-16 41997/week @ 2024-03-23 43954/week @ 2024-03-30 36292/week @ 2024-04-06

172,475 downloads per month
Used in 188 crates (via tracing-test)

MIT license

10KB
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-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

~1.5MB
~33K SLoC