Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/bin/rustup-init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,19 @@
//! different name.

#![recursion_limit = "1024"]
#![feature(rt)]

use std::path::PathBuf;
#[cfg(feature = "rt")]
use std::rt;

use cfg_if::cfg_if;
use rs_tracing::*;

use rustup::cli::common;
use rustup::cli::errors::*;
#[cfg(feature = "rt")]
use rustup::cli::log;
use rustup::cli::proxy_mode;
use rustup::cli::rustup_mode;
#[cfg(windows)]
Expand All @@ -42,6 +47,10 @@ fn main() {
}

fn run_rustup() -> Result<utils::ExitCode> {
#[cfg(feature = "rt")]
{
let _ = rt::at_exit(log::on_quit_log);
}
if let Ok(dir) = process().var("RUSTUP_TRACE_DIR") {
open_trace_file!(dir)?;
}
Expand Down
5 changes: 5 additions & 0 deletions src/cli/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ macro_rules! debug {
( $ ( $ arg : tt ) * ) => ( $crate::cli::log::debug_fmt ( format_args ! ( $ ( $ arg ) * ) ) )
}

pub fn on_quit_log() {
let mut t = term2::stderr();
let _ = t.reset();
}

pub fn warn_fmt(args: fmt::Arguments<'_>) {
let mut t = term2::stderr();
let _ = t.fg(term2::color::YELLOW);
Expand Down