Registry / testing / test-log

test-log

JSON →
library0.2.21rscratesunverified

A replacement for the `#[test]` attribute that initializes logging or tracing before running tests.

# Cargo.toml [dependencies] test-log = "0.2.21"
INSTALL
IMPORT
SIG · TEST-LOG
T
test-log
testingrustv0.2.21
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

test
use test_log::test;

Use `#[test_log::test]` instead of `#[test]` to automatically initialize logging.

use test_log::test; #[test] fn my_test() { log::info!("This test has logging enabled"); assert_eq!(2 + 2, 4); }
Debug
Known issues
gotchaRequires the `log` or `tracing` crate to be in scope; otherwise, no output is produced.
fix
Add `log` or `tracing` as a dependency and ensure it's initialized (e.g., with `env_logger`).
affects: >=0.2.0
Upgrade
Version history
0.2.21latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
36 hits · last 30 days
node
30
Resources
test-log — cargo add test-log · libregistry