Skip to content

Commit c52bda5

Browse files
committed
internal: switch to tracing from log
1 parent 88313f1 commit c52bda5

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ members = ["xtask"]
1616

1717
[dependencies]
1818
# Enable `log` feature to log assertion failures.
19-
log = { version="0.4", optional=true }
19+
tracing = { version="0.1", optional=true }
2020

2121
[features]
2222
# Escalate assertion failure to panic even if `debug_assertions` are not set.

src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
///
4848
/// If the condition is false:
4949
/// * panics if `force` feature or `debug_assertions` are enabled,
50-
/// * logs an error if `log` feature is enabled,
50+
/// * logs an error if the `tracing` feature is enabled,
5151
/// * evaluates to false.
5252
///
5353
/// Accepts `format!` style arguments.
@@ -63,7 +63,7 @@ macro_rules! always {
6363
assert!(cond, $fmt $($arg)*);
6464
}
6565
if !cond {
66-
$crate::__log_error!($fmt $($arg)*);
66+
$crate::__tracing_error!($fmt $($arg)*);
6767
}
6868
cond
6969
}};
@@ -75,7 +75,7 @@ macro_rules! always {
7575
///
7676
/// If the condition is true:
7777
/// * panics if `force` feature or `debug_assertions` are enabled,
78-
/// * logs an error if `log` feature is enabled,
78+
/// * logs an error if the `tracing` feature is enabled,
7979
/// * evaluates to true.
8080
///
8181
/// Accepts `format!` style arguments.
@@ -94,7 +94,7 @@ macro_rules! never {
9494
if cfg!(debug_assertions) || $crate::__FORCE {
9595
unreachable!($fmt $(, $($arg)*)?);
9696
}
97-
$crate::__log_error!($fmt $(, $($arg)*)?);
97+
$crate::__tracing_error!($fmt $(, $($arg)*)?);
9898
}};
9999

100100
($cond:expr) => {{
@@ -108,14 +108,14 @@ macro_rules! never {
108108
}};
109109
}
110110

111-
#[cfg(feature = "log")]
111+
#[cfg(feature = "tracing")]
112112
#[doc(hidden)]
113-
pub use log::error as __log_error;
113+
pub use tracing::error as __tracing_error;
114114

115-
#[cfg(not(feature = "log"))]
115+
#[cfg(not(feature = "tracing"))]
116116
#[doc(hidden)]
117117
#[macro_export]
118-
macro_rules! __log_error {
118+
macro_rules! __tracing_error {
119119
($($tt:tt)*) => {};
120120
}
121121

xtask/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ fn try_main() -> Result<()> {
2424
{
2525
let _s = section("TEST");
2626
for &release in &[None, Some("--release")] {
27-
for &log in &[&[][..], &["--features", "log"]] {
27+
for &tracing in &[&[][..], &["--features", "tracubg"]] {
2828
for &force in &[&[][..], &["--features", "force"]] {
2929
cmd!(
30-
"cargo test {release...} {log...} {force...}
30+
"cargo test {release...} {tracing...} {force...}
3131
--workspace -- --nocapture"
3232
)
3333
.run()?;

0 commit comments

Comments
 (0)