File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 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> {
7474 Some ( v) => & v != "0" ,
7575 } ;
7676
77+ let verbose_thread_ids = match env:: var_os ( String :: from ( env) + "_THREAD_IDS" ) {
78+ None => false ,
79+ Some ( v) => & v == "1" ,
80+ } ;
81+
7782 let layer = tracing_tree:: HierarchicalLayer :: default ( )
7883 . with_writer ( io:: stderr)
7984 . with_indent_lines ( true )
8085 . with_ansi ( color_logs)
8186 . with_targets ( true )
8287 . with_verbose_exit ( verbose_entry_exit)
8388 . 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 ) ;
8792
8893 let subscriber = tracing_subscriber:: Registry :: default ( ) . with ( filter) . with ( layer) ;
8994 match env:: var ( format ! ( "{env}_BACKTRACE" ) ) {
You can’t perform that action at this time.
0 commit comments