File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
crates/common/tedge_config Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ tracing = { workspace = true }
3939tracing-subscriber = { workspace = true }
4040url = { workspace = true }
4141which = { workspace = true }
42+ yansi = { workspace = true }
4243
4344[dev-dependencies ]
4445assert_matches = { workspace = true }
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ macro_rules! subscriber_builder {
1212 ( ) => {
1313 tracing_subscriber:: fmt( )
1414 . with_writer( std:: io:: stderr)
15- . with_ansi( std:: io:: stderr( ) . is_terminal( ) )
15+ . with_ansi( std:: io:: stderr( ) . is_terminal( ) && yansi :: Condition :: no_color ( ) )
1616 . with_timer( tracing_subscriber:: fmt:: time:: UtcTime :: rfc_3339( ) )
1717 } ;
1818}
@@ -75,7 +75,7 @@ fn logger(
7575) -> Result < Arc < dyn tracing:: Subscriber + Send + Sync > , SystemTomlError > {
7676 let subscriber = tracing_subscriber:: fmt ( )
7777 . with_writer ( std:: io:: stderr)
78- . with_ansi ( std:: io:: stderr ( ) . is_terminal ( ) )
78+ . with_ansi ( std:: io:: stderr ( ) . is_terminal ( ) && yansi :: Condition :: no_color ( ) )
7979 . with_timer ( tracing_subscriber:: fmt:: time:: UtcTime :: rfc_3339 ( ) ) ;
8080 let log_level = flags
8181 . log_level
@@ -124,7 +124,7 @@ pub fn get_log_level(
124124pub fn set_log_level ( log_level : tracing:: Level ) {
125125 let subscriber = tracing_subscriber:: fmt ( )
126126 . with_writer ( std:: io:: stderr)
127- . with_ansi ( std:: io:: stderr ( ) . is_terminal ( ) )
127+ . with_ansi ( std:: io:: stderr ( ) . is_terminal ( ) && yansi :: Condition :: no_color ( ) )
128128 . with_timer ( tracing_subscriber:: fmt:: time:: UtcTime :: rfc_3339 ( ) ) ;
129129
130130 if std:: env:: var ( "RUST_LOG" ) . is_ok ( ) {
You can’t perform that action at this time.
0 commit comments