Skip to content

Commit ec7230f

Browse files
committed
Move from log to tracing
1 parent 6e87bac commit ec7230f

File tree

38 files changed

+165
-84
lines changed

38 files changed

+165
-84
lines changed

Cargo.lock

+123-45
Large diffs are not rendered by default.

src/librustc_ast/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ doctest = false
1111

1212
[dependencies]
1313
rustc_serialize = { path = "../librustc_serialize" }
14-
log = "0.4"
14+
log = { package = "tracing", version = "0.1" }
1515
scoped-tls = "1.0"
1616
rustc_span = { path = "../librustc_span" }
1717
rustc_data_structures = { path = "../librustc_data_structures" }

src/librustc_ast_lowering/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ doctest = false
1111

1212
[dependencies]
1313
rustc_arena = { path = "../librustc_arena" }
14-
log = { version = "0.4", features = ["release_max_level_info", "std"] }
14+
log = { package = "tracing", version = "0.1" }
1515
rustc_ast_pretty = { path = "../librustc_ast_pretty" }
1616
rustc_hir = { path = "../librustc_hir" }
1717
rustc_target = { path = "../librustc_target" }

src/librustc_ast_passes/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ path = "lib.rs"
1010

1111
[dependencies]
1212
itertools = "0.8"
13-
log = "0.4"
13+
log = { package = "tracing", version = "0.1" }
1414
rustc_ast_pretty = { path = "../librustc_ast_pretty" }
1515
rustc_attr = { path = "../librustc_attr" }
1616
rustc_data_structures = { path = "../librustc_data_structures" }

src/librustc_ast_pretty/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ path = "lib.rs"
1010
doctest = false
1111

1212
[dependencies]
13-
log = "0.4"
13+
log = { package = "tracing", version = "0.1" }
1414
rustc_span = { path = "../librustc_span" }
1515
rustc_ast = { path = "../librustc_ast" }
1616
rustc_target = { path = "../librustc_target" }

src/librustc_builtin_macros/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ doctest = false
1111

1212
[dependencies]
1313
rustc_parse_format = { path = "../librustc_parse_format" }
14-
log = "0.4"
14+
log = { package = "tracing", version = "0.1" }
1515
rustc_ast_pretty = { path = "../librustc_ast_pretty" }
1616
rustc_attr = { path = "../librustc_attr" }
1717
rustc_data_structures = { path = "../librustc_data_structures" }

src/librustc_codegen_llvm/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ bitflags = "1.0"
1515
flate2 = "1.0"
1616
libc = "0.2"
1717
measureme = "0.7.1"
18-
log = "0.4"
18+
log = { package = "tracing", version = "0.1" }
1919
rustc_middle = { path = "../librustc_middle" }
2020
rustc-demangle = "0.1"
2121
rustc_attr = { path = "../librustc_attr" }

src/librustc_codegen_ssa/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ bitflags = "1.2.1"
1414
cc = "1.0.1"
1515
num_cpus = "1.0"
1616
memmap = "0.7"
17-
log = "0.4.5"
17+
log = { package = "tracing", version = "0.1" }
1818
libc = "0.2.50"
1919
jobserver = "0.1.11"
2020
tempfile = "3.1"

src/librustc_data_structures/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ doctest = false
1212
[dependencies]
1313
ena = "0.14"
1414
indexmap = "1"
15-
log = "0.4"
15+
log = { package = "tracing", version = "0.1" }
1616
jobserver_crate = { version = "0.1.13", package = "jobserver" }
1717
lazy_static = "1"
1818
once_cell = { version = "1", features = ["parking_lot"] }

src/librustc_driver/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ crate-type = ["dylib"]
1212
[dependencies]
1313
lazy_static = "1.0"
1414
libc = "0.2"
15-
log = "0.4"
16-
env_logger = { version = "0.7", default-features = false }
15+
log = { package = "tracing", version = "0.1.18", features = ["release_max_level_info"] }
16+
tracing-subscriber = { version = "0.2.10", features = ["fmt", "env-filter"] }
1717
rustc_middle = { path = "../librustc_middle" }
1818
rustc_ast_pretty = { path = "../librustc_ast_pretty" }
1919
rustc_target = { path = "../librustc_target" }

src/librustc_driver/lib.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,11 @@ pub fn install_ice_hook() {
12261226
/// This allows tools to enable rust logging without having to magically match rustc's
12271227
/// log crate version
12281228
pub fn init_rustc_env_logger() {
1229-
env_logger::init_from_env("RUSTC_LOG");
1229+
let builder = tracing_subscriber::FmtSubscriber::builder();
1230+
1231+
let builder = builder.with_env_filter(tracing_subscriber::EnvFilter::from_env("RUSTC_LOG"));
1232+
1233+
builder.init()
12301234
}
12311235

12321236
pub fn main() -> ! {

src/librustc_errors/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ path = "lib.rs"
1010
doctest = false
1111

1212
[dependencies]
13-
log = "0.4"
13+
log = { package = "tracing", version = "0.1" }
1414
rustc_serialize = { path = "../librustc_serialize" }
1515
rustc_span = { path = "../librustc_span" }
1616
rustc_data_structures = { path = "../librustc_data_structures" }

src/librustc_expand/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ doctest = false
1212

1313
[dependencies]
1414
rustc_serialize = { path = "../librustc_serialize" }
15-
log = "0.4"
15+
log = { package = "tracing", version = "0.1" }
1616
rustc_span = { path = "../librustc_span" }
1717
rustc_ast_pretty = { path = "../librustc_ast_pretty" }
1818
rustc_ast_passes = { path = "../librustc_ast_passes" }

src/librustc_hir/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ rustc_span = { path = "../librustc_span" }
1818
rustc_serialize = { path = "../librustc_serialize" }
1919
rustc_ast = { path = "../librustc_ast" }
2020
lazy_static = "1"
21-
log = { version = "0.4", features = ["release_max_level_info", "std"] }
21+
log = { package = "tracing", version = "0.1" }
2222
smallvec = { version = "1.0", features = ["union", "may_dangle"] }

src/librustc_incremental/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ doctest = false
1111

1212
[dependencies]
1313
rustc_graphviz = { path = "../librustc_graphviz" }
14-
log = "0.4"
14+
log = { package = "tracing", version = "0.1" }
1515
rand = "0.7"
1616
rustc_middle = { path = "../librustc_middle" }
1717
rustc_data_structures = { path = "../librustc_data_structures" }

src/librustc_infer/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ doctest = false
1111

1212
[dependencies]
1313
rustc_graphviz = { path = "../librustc_graphviz" }
14-
log = { version = "0.4", features = ["release_max_level_info", "std"] }
14+
log = { package = "tracing", version = "0.1" }
1515
rustc_middle = { path = "../librustc_middle" }
1616
rustc_data_structures = { path = "../librustc_data_structures" }
1717
rustc_errors = { path = "../librustc_errors" }

src/librustc_interface/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ doctest = false
1111

1212
[dependencies]
1313
libc = "0.2"
14-
log = "0.4"
14+
log = { package = "tracing", version = "0.1" }
1515
rayon = { version = "0.3.0", package = "rustc-rayon" }
1616
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
1717
rustc_ast = { path = "../librustc_ast" }

src/librustc_lint/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ name = "rustc_lint"
99
path = "lib.rs"
1010

1111
[dependencies]
12-
log = "0.4"
12+
log = { package = "tracing", version = "0.1" }
1313
unicode-security = "0.0.5"
1414
rustc_middle = { path = "../librustc_middle" }
1515
rustc_ast_pretty = { path = "../librustc_ast_pretty" }

src/librustc_metadata/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ doctest = false
1212
[dependencies]
1313
flate2 = "1.0"
1414
libc = "0.2"
15-
log = "0.4"
15+
log = { package = "tracing", version = "0.1" }
1616
memmap = "0.7"
1717
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
1818
rustc_middle = { path = "../librustc_middle" }

src/librustc_middle/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ doctest = false
1313
rustc_arena = { path = "../librustc_arena" }
1414
bitflags = "1.2.1"
1515
scoped-tls = "1.0"
16-
log = { version = "0.4", features = ["release_max_level_info", "std"] }
16+
log = { package = "tracing", version = "0.1" }
1717
rustc-rayon-core = "0.3.0"
1818
polonius-engine = "0.12.0"
1919
rustc_apfloat = { path = "../librustc_apfloat" }

src/librustc_mir/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ doctest = false
1313
either = "1.5.0"
1414
rustc_graphviz = { path = "../librustc_graphviz" }
1515
itertools = "0.8"
16-
log = "0.4"
16+
log = { package = "tracing", version = "0.1" }
1717
log_settings = "0.1.1"
1818
polonius-engine = "0.12.0"
1919
rustc_middle = { path = "../librustc_middle" }

src/librustc_mir/interpret/eval_context.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -818,11 +818,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
818818
) -> InterpResult<'tcx> {
819819
// FIXME: should we tell the user that there was a local which was never written to?
820820
if let LocalValue::Live(Operand::Indirect(MemPlace { ptr, .. })) = local {
821-
trace!("deallocating local");
822821
// All locals have a backing allocation, even if the allocation is empty
823822
// due to the local having ZST type.
824823
let ptr = ptr.assert_ptr();
825-
trace!("{:?}", self.memory.dump_alloc(ptr.alloc_id));
824+
trace!("deallocating local: {:?}", self.memory.dump_alloc(ptr.alloc_id));
826825
self.memory.deallocate_local(ptr)?;
827826
};
828827
Ok(())

src/librustc_mir_build/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ doctest = false
1111

1212
[dependencies]
1313
rustc_arena = { path = "../librustc_arena" }
14-
log = "0.4"
14+
log = { package = "tracing", version = "0.1" }
1515
rustc_middle = { path = "../librustc_middle" }
1616
rustc_apfloat = { path = "../librustc_apfloat" }
1717
rustc_attr = { path = "../librustc_attr" }

src/librustc_parse/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ doctest = false
1111

1212
[dependencies]
1313
bitflags = "1.0"
14-
log = "0.4"
14+
log = { package = "tracing", version = "0.1" }
1515
rustc_ast_pretty = { path = "../librustc_ast_pretty" }
1616
rustc_data_structures = { path = "../librustc_data_structures" }
1717
rustc_feature = { path = "../librustc_feature" }

src/librustc_passes/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ name = "rustc_passes"
99
path = "lib.rs"
1010

1111
[dependencies]
12-
log = "0.4"
12+
log = { package = "tracing", version = "0.1" }
1313
rustc_middle = { path = "../librustc_middle" }
1414
rustc_attr = { path = "../librustc_attr" }
1515
rustc_data_structures = { path = "../librustc_data_structures" }

src/librustc_privacy/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ rustc_typeck = { path = "../librustc_typeck" }
1717
rustc_session = { path = "../librustc_session" }
1818
rustc_span = { path = "../librustc_span" }
1919
rustc_data_structures = { path = "../librustc_data_structures" }
20-
log = "0.4"
20+
log = { package = "tracing", version = "0.1" }

src/librustc_query_system/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ doctest = false
1111

1212
[dependencies]
1313
rustc_arena = { path = "../librustc_arena" }
14-
log = { version = "0.4", features = ["release_max_level_info", "std"] }
14+
log = { package = "tracing", version = "0.1" }
1515
rustc-rayon-core = "0.3.0"
1616
rustc_data_structures = { path = "../librustc_data_structures" }
1717
rustc_errors = { path = "../librustc_errors" }

src/librustc_resolve/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ doctest = false
1212

1313
[dependencies]
1414
bitflags = "1.2.1"
15-
log = "0.4"
15+
log = { package = "tracing", version = "0.1" }
1616
rustc_ast = { path = "../librustc_ast" }
1717
rustc_arena = { path = "../librustc_arena" }
1818
rustc_middle = { path = "../librustc_middle" }

src/librustc_save_analysis/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ name = "rustc_save_analysis"
99
path = "lib.rs"
1010

1111
[dependencies]
12-
log = "0.4"
12+
log = { package = "tracing", version = "0.1" }
1313
rustc_middle = { path = "../librustc_middle" }
1414
rustc_ast = { path = "../librustc_ast" }
1515
rustc_ast_pretty = { path = "../librustc_ast_pretty" }

src/librustc_session/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ path = "lib.rs"
1111
[dependencies]
1212
bitflags = "1.2.1"
1313
getopts = "0.2"
14-
log = "0.4"
14+
log = { package = "tracing", version = "0.1" }
1515
rustc_errors = { path = "../librustc_errors" }
1616
rustc_feature = { path = "../librustc_feature" }
1717
rustc_target = { path = "../librustc_target" }

src/librustc_span/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ rustc_arena = { path = "../librustc_arena" }
1818
scoped-tls = "1.0"
1919
unicode-width = "0.1.4"
2020
cfg-if = "0.1.2"
21-
log = "0.4"
21+
log = { package = "tracing", version = "0.1" }
2222
sha-1 = "0.8"
2323
md-5 = "0.8"

src/librustc_symbol_mangling/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ path = "lib.rs"
1010
doctest = false
1111

1212
[dependencies]
13-
log = "0.4"
13+
log = { package = "tracing", version = "0.1" }
1414
punycode = "0.4.0"
1515
rustc-demangle = "0.1.16"
1616

src/librustc_target/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ path = "lib.rs"
1010

1111
[dependencies]
1212
bitflags = "1.2.1"
13-
log = "0.4"
13+
log = { package = "tracing", version = "0.1" }
1414
rustc_data_structures = { path = "../librustc_data_structures" }
1515
rustc_macros = { path = "../librustc_macros" }
1616
rustc_serialize = { path = "../librustc_serialize" }

src/librustc_trait_selection/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ doctest = false
1111

1212
[dependencies]
1313
rustc_parse_format = { path = "../librustc_parse_format" }
14-
log = { version = "0.4", features = ["release_max_level_info", "std"] }
14+
log = { package = "tracing", version = "0.1" }
1515
rustc_attr = { path = "../librustc_attr" }
1616
rustc_middle = { path = "../librustc_middle" }
1717
rustc_ast = { path = "../librustc_ast" }

src/librustc_traits/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ name = "rustc_traits"
99
path = "lib.rs"
1010

1111
[dependencies]
12-
log = { version = "0.4" }
12+
log = { package = "tracing", version = "0.1" }
1313
rustc_middle = { path = "../librustc_middle" }
1414
rustc_data_structures = { path = "../librustc_data_structures" }
1515
rustc_hir = { path = "../librustc_hir" }

src/librustc_ty/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ name = "rustc_ty"
99
path = "lib.rs"
1010

1111
[dependencies]
12-
log = "0.4"
12+
log = { package = "tracing", version = "0.1" }
1313
rustc_middle = { path = "../librustc_middle" }
1414
rustc_data_structures = { path = "../librustc_data_structures" }
1515
rustc_errors = { path = "../librustc_errors" }

src/librustc_typeck/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ doctest = false
1212

1313
[dependencies]
1414
rustc_arena = { path = "../librustc_arena" }
15-
log = "0.4"
15+
log = { package = "tracing", version = "0.1" }
1616
rustc_middle = { path = "../librustc_middle" }
1717
rustc_attr = { path = "../librustc_attr" }
1818
rustc_data_structures = { path = "../librustc_data_structures" }

src/tools/compiletest/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2018"
88
diff = "0.1.10"
99
env_logger = { version = "0.7", default-features = false }
1010
getopts = "0.2"
11-
log = "0.4"
11+
log = { package = "tracing", version = "0.1" }
1212
regex = "1.0"
1313
serde = { version = "1.0", features = ["derive"] }
1414
serde_json = "1.0"

0 commit comments

Comments
 (0)