File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -74,16 +74,21 @@ pub fn init_env_logger(env: &str) -> Result<(), Error> {
74
74
Some ( v) => & v != "0" ,
75
75
} ;
76
76
77
+ let verbose_thread_ids = match env:: var_os ( String :: from ( env) + "_THREAD_IDS" ) {
78
+ None => false ,
79
+ Some ( v) => & v == "1" ,
80
+ } ;
81
+
77
82
let layer = tracing_tree:: HierarchicalLayer :: default ( )
78
83
. with_writer ( io:: stderr)
79
84
. with_indent_lines ( true )
80
85
. with_ansi ( color_logs)
81
86
. with_targets ( true )
82
87
. with_verbose_exit ( verbose_entry_exit)
83
88
. with_verbose_entry ( verbose_entry_exit)
84
- . with_indent_amount ( 2 ) ;
85
- # [ cfg ( all ( parallel_compiler , debug_assertions ) ) ]
86
- let layer = layer . with_thread_ids ( true ) . with_thread_names ( true ) ;
89
+ . with_indent_amount ( 2 )
90
+ . with_thread_ids ( verbose_thread_ids )
91
+ . with_thread_names ( verbose_thread_ids ) ;
87
92
88
93
let subscriber = tracing_subscriber:: Registry :: default ( ) . with ( filter) . with ( layer) ;
89
94
match env:: var ( format ! ( "{env}_BACKTRACE" ) ) {
You can’t perform that action at this time.
0 commit comments