diff options
| author | Stypox <stypox@pm.me> | 2025-05-12 16:27:09 +0200 |
|---|---|---|
| committer | Stypox <stypox@pm.me> | 2025-06-11 10:41:22 +0200 |
| commit | 0d74252537b6fd3ae6287486dbeec437cf021efa (patch) | |
| tree | e48f8ef3b9b0c8dd323b47c2ec62e4802df4c5b3 /compiler/rustc_driver_impl | |
| parent | 2b0274c71dba0e24370ebf65593da450e2e91868 (diff) | |
| download | rust-0d74252537b6fd3ae6287486dbeec437cf021efa.tar.gz rust-0d74252537b6fd3ae6287486dbeec437cf021efa.zip | |
Allow initializing logger with additional tracing Layer
Diffstat (limited to 'compiler/rustc_driver_impl')
| -rw-r--r-- | compiler/rustc_driver_impl/src/lib.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index 54a331a4904..83552af5a0e 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -1507,6 +1507,17 @@ pub fn init_logger(early_dcx: &EarlyDiagCtxt, cfg: rustc_log::LoggerConfig) { } } +pub fn init_logger_with_additional_layer( + early_dcx: &EarlyDiagCtxt, + cfg: rustc_log::LoggerConfig, + additional_tracing_layer: impl rustc_log::Layer<rustc_log::Registry> + Send + Sync, +) { + if let Err(error) = rustc_log::init_logger_with_additional_layer(cfg, additional_tracing_layer) + { + early_dcx.early_fatal(error.to_string()); + } +} + /// Install our usual `ctrlc` handler, which sets [`rustc_const_eval::CTRL_C_RECEIVED`]. /// Making this handler optional lets tools can install a different handler, if they wish. pub fn install_ctrlc_handler() { |
