Skip to content

Commit c10463b

Browse files
authored
fix: pin tracing-subscriber to 0.3.19 to fix ANSI color output (#129)
Pin to v0.3.19 as newer versions escape ANSI codes incorrectly, causing colored output to display as literal `\x1b[...` text instead of actual terminal colors. This matches the sway repo and fixes test failures there.
1 parent 1409bfb commit c10463b

File tree

5 files changed

+62
-36
lines changed

5 files changed

+62
-36
lines changed

Cargo.lock

Lines changed: 44 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ tempfile = "3"
4141
termion = "4.0"
4242
tokio = "1.48"
4343
tracing = "0.1"
44-
tracing-subscriber = "0.3.22"
44+
tracing-subscriber = "0.3.19"
4545
tracing-test = "0.2"
4646
serial_test = "3"
4747
url = "2.5"

forc-tracing/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 0.71.1 (December 9th, 2025)
2+
3+
### Fixed
4+
5+
- Pin `tracing-subscriber` to 0.3.19 to fix ANSI color output being escaped as literal text
6+
17
# 0.71.0 (December 8th, 2025)
28

39
### Changed

forc-tracing/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name = "forc-tracing"
44
# - Remove path dependencies
55
# - Update CHANGELOG.md.
66
# - Create "forc-tracing-0.71.x" git tag.
7-
version = "0.71.0"
7+
version = "0.71.1"
88
description = "Tracing utility shared between forc crates."
99
edition = "2021"
1010
authors.workspace = true

forc-tracing/src/lib.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ mod tests {
325325
let txt = "main.sw";
326326
println_label_green("Compiling", txt);
327327

328-
// tracing-test escapes ANSI codes to literal text
329-
assert!(logs_contain(r"\x1b[1;32mCompiling\x1b[0m main.sw"));
328+
let expected_action = "\x1b[1;32mCompiling\x1b[0m";
329+
assert!(logs_contain(&format!("{expected_action} {txt}")));
330330
}
331331

332332
#[traced_test]
@@ -338,8 +338,8 @@ mod tests {
338338
let txt = "main.sw";
339339
println_label_red("Error", txt);
340340

341-
// tracing-test escapes ANSI codes to literal text
342-
assert!(logs_contain(r"\x1b[1;31mError\x1b[0m main.sw"));
341+
let expected_action = "\x1b[1;31mError\x1b[0m";
342+
assert!(logs_contain(&format!("{expected_action} {txt}")));
343343
}
344344

345345
#[traced_test]
@@ -351,8 +351,8 @@ mod tests {
351351
let txt = "main.sw";
352352
println_action_green("Compiling", txt);
353353

354-
// tracing-test escapes ANSI codes to literal text
355-
assert!(logs_contain(r" \x1b[1;32mCompiling\x1b[0m main.sw"));
354+
let expected_action = "\x1b[1;32mCompiling\x1b[0m";
355+
assert!(logs_contain(&format!(" {expected_action} {txt}")));
356356
}
357357

358358
#[traced_test]
@@ -364,10 +364,8 @@ mod tests {
364364
let txt = "main.sw";
365365
println_action_green("Supercalifragilistic", txt);
366366

367-
// tracing-test escapes ANSI codes to literal text
368-
assert!(logs_contain(
369-
r"\x1b[1;32mSupercalifragilistic\x1b[0m main.sw"
370-
));
367+
let expected_action = "\x1b[1;32mSupercalifragilistic\x1b[0m";
368+
assert!(logs_contain(&format!("{expected_action} {txt}")));
371369
}
372370

373371
#[traced_test]
@@ -379,8 +377,8 @@ mod tests {
379377
let txt = "main";
380378
println_action_red("Removing", txt);
381379

382-
// tracing-test escapes ANSI codes to literal text
383-
assert!(logs_contain(r" \x1b[1;31mRemoving\x1b[0m main"));
380+
let expected_action = "\x1b[1;31mRemoving\x1b[0m";
381+
assert!(logs_contain(&format!(" {expected_action} {txt}")));
384382
}
385383

386384
#[traced_test]

0 commit comments

Comments
 (0)