File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,13 @@ use tracing::{info_span, Instrument};
66use turmoil:: { net, Builder } ;
77
88fn main ( ) {
9- if std:: env:: var ( "RUST_LOG" ) . is_err ( ) {
10- std:: env:: set_var ( "RUST_LOG" , "info" ) ;
11- }
12-
13- tracing_subscriber:: fmt:: init ( ) ;
9+ tracing_subscriber:: fmt ( )
10+ . with_env_filter (
11+ tracing_subscriber:: EnvFilter :: builder ( )
12+ . with_default_directive ( tracing:: level_filters:: LevelFilter :: INFO . into ( ) )
13+ . from_env_lossy ( ) ,
14+ )
15+ . init ( ) ;
1416
1517 let addr = ( IpAddr :: from ( Ipv4Addr :: UNSPECIFIED ) , 9999 ) ;
1618
Original file line number Diff line number Diff line change @@ -66,13 +66,13 @@ fn main() {
6666/// An example of how to configure a tracing subscriber that will log logical
6767/// elapsed time since the simulation started using `turmoil::sim_elapsed()`.
6868fn configure_tracing ( ) {
69- if std:: env:: var ( "RUST_LOG" ) . is_err ( ) {
70- std:: env:: set_var ( "RUST_LOG" , "info" ) ;
71- }
72-
7369 tracing:: subscriber:: set_global_default (
7470 tracing_subscriber:: fmt ( )
75- . with_env_filter ( tracing_subscriber:: EnvFilter :: from_default_env ( ) )
71+ . with_env_filter (
72+ tracing_subscriber:: EnvFilter :: builder ( )
73+ . with_default_directive ( tracing:: level_filters:: LevelFilter :: INFO . into ( ) )
74+ . from_env_lossy ( ) ,
75+ )
7676 . with_timer ( SimElapsedTime )
7777 . finish ( ) ,
7878 )
You can’t perform that action at this time.
0 commit comments