@@ -10,10 +10,11 @@ use clap::{builder::PossibleValue, Args, CommandFactory, Parser, Subcommand, Val
10
10
use clap_complete:: Shell ;
11
11
use itertools:: Itertools ;
12
12
use tracing:: { info, trace, warn} ;
13
+ use tracing_subscriber:: { reload:: Handle , EnvFilter , Registry } ;
13
14
14
15
use crate :: {
15
16
cli:: {
16
- common:: { self , PackageUpdate } ,
17
+ common:: { self , update_console_filter , PackageUpdate } ,
17
18
errors:: CLIError ,
18
19
help:: * ,
19
20
self_update:: { self , check_rustup_update, SelfUpdateMode } ,
@@ -68,11 +69,11 @@ fn handle_epipe(res: Result<utils::ExitCode>) -> Result<utils::ExitCode> {
68
69
after_help = RUSTUP_HELP ,
69
70
) ]
70
71
struct Rustup {
71
- /// Enable verbose output
72
- #[ arg( short, long) ]
72
+ /// Set log level to 'DEBUG' if 'RUSTUP_LOG' is unset
73
+ #[ arg( short, long, conflicts_with = "quiet" ) ]
73
74
verbose : bool ,
74
75
75
- /// Disable progress output
76
+ /// Disable progress output, set log level to 'WARN' if 'RUSTUP_LOG' is unset
76
77
#[ arg( short, long, conflicts_with = "verbose" ) ]
77
78
quiet : bool ,
78
79
@@ -532,7 +533,11 @@ enum SetSubcmd {
532
533
}
533
534
534
535
#[ tracing:: instrument( level = "trace" , fields( args = format!( "{:?}" , process. args_os( ) . collect:: <Vec <_>>( ) ) ) ) ]
535
- pub async fn main ( current_dir : PathBuf , process : & Process ) -> Result < utils:: ExitCode > {
536
+ pub async fn main (
537
+ current_dir : PathBuf ,
538
+ process : & Process ,
539
+ console_filter : Handle < EnvFilter , Registry > ,
540
+ ) -> Result < utils:: ExitCode > {
536
541
self_update:: cleanup_self_updater ( process) ?;
537
542
538
543
use clap:: error:: ErrorKind :: * ;
@@ -570,6 +575,8 @@ pub async fn main(current_dir: PathBuf, process: &Process) -> Result<utils::Exit
570
575
}
571
576
} ;
572
577
578
+ update_console_filter ( process, & console_filter, matches. quiet , matches. verbose ) ;
579
+
573
580
let cfg = & mut common:: set_globals ( current_dir, matches. quiet , process) ?;
574
581
575
582
if let Some ( t) = & matches. plus_toolchain {
0 commit comments