File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,6 @@ use std::{
1616use sysinfo:: { ProcessExt , System , SystemExt } ;
1717
1818fn main ( ) -> std:: io:: Result < ( ) > {
19- env:: set_var ( "RUST_LOG" , "swhks=warn" ) ;
20-
2119 let app = clap:: Command :: new ( "swhks" )
2220 . version ( env ! ( "CARGO_PKG_VERSION" ) )
2321 . author ( env ! ( "CARGO_PKG_AUTHORS" ) )
@@ -30,11 +28,13 @@ fn main() -> std::io::Result<()> {
3028 ) ) ;
3129 let args = app. get_matches ( ) ;
3230 if args. is_present ( "debug" ) {
33- env:: set_var ( "RUST_LOG" , "swhks=trace" ) ;
31+ env_logger:: Builder :: from_env ( env_logger:: Env :: default ( ) . default_filter_or ( "swhks=trace" ) )
32+ . init ( ) ;
33+ } else {
34+ env_logger:: Builder :: from_env ( env_logger:: Env :: default ( ) . default_filter_or ( "swhks=warn" ) )
35+ . init ( ) ;
3436 }
3537
36- env_logger:: init ( ) ;
37-
3838 log:: trace!( "Setting process umask." ) ;
3939 umask ( Mode :: S_IWGRP | Mode :: S_IWOTH ) ;
4040
You can’t perform that action at this time.
0 commit comments