@@ -38,23 +38,25 @@ fn init_logs() -> Result<sdklogs::LoggerProvider> {
3838mod logtests {
3939 use super :: * ;
4040 use integration_test_runner:: logs_asserter:: { read_logs_from_json, LogsAsserter } ;
41+ use opentelemetry_appender_tracing:: layer:: OpenTelemetryTracingBridge ;
4142 use std:: { fs:: File , time:: Duration } ;
4243 use tracing:: info;
4344 use tracing_subscriber:: layer:: SubscriberExt ;
44- use opentelemetry_appender_tracing:: layer:: OpenTelemetryTracingBridge ;
4545
4646 #[ test]
4747 #[ should_panic( expected = "assertion `left == right` failed: body does not match" ) ]
4848 pub fn test_assert_logs_eq_failure ( ) {
49- let left = read_logs_from_json ( File :: open ( "./expected/logs.json" )
50- . expect ( "failed to open expected file" ) )
51- . expect ( "Failed to read logs from expected file" ) ;
49+ let left = read_logs_from_json (
50+ File :: open ( "./expected/logs.json" ) . expect ( "failed to open expected file" ) ,
51+ )
52+ . expect ( "Failed to read logs from expected file" ) ;
5253
53- let right = read_logs_from_json ( File :: open ( "./expected/failed_logs.json" )
54- . expect ( "failed to open expected failed log file" ) )
55- . expect ( "Failed to read logs from expected failed log file" ) ;
54+ let right = read_logs_from_json (
55+ File :: open ( "./expected/failed_logs.json" )
56+ . expect ( "failed to open expected failed log file" ) ,
57+ )
58+ . expect ( "Failed to read logs from expected failed log file" ) ;
5659 LogsAsserter :: new ( right, left) . assert ( ) ;
57-
5860 }
5961
6062 #[ test]
@@ -99,14 +101,13 @@ mod logtests {
99101
100102 #[ test]
101103 #[ cfg( any( feature = "tonic-client" , feature = "reqwest-blocking-client" ) ) ]
102- pub fn logs_batch_non_tokio_main ( ) -> Result < ( ) > {
103-
104+ pub fn logs_batch_non_tokio_main ( ) -> Result < ( ) > {
104105 // Initialize the logger provider inside a tokio runtime
105106 // as this allows tonic client to capture the runtime,
106107 // but actual export occurs from the dedicated std::thread
107108 // created by BatchLogProcessor.
108109 let rt = tokio:: runtime:: Runtime :: new ( ) ?;
109- let logger_provider = rt. block_on ( async {
110+ let logger_provider = rt. block_on ( async {
110111 // While we're here setup our collector container too, as this needs tokio to run
111112 test_utils:: start_collector_container ( ) . await ?;
112113 init_logs ( )
@@ -125,7 +126,6 @@ mod logtests {
125126
126127 Ok ( ( ) )
127128 }
128-
129129}
130130
131131pub fn assert_logs_results ( result : & str , expected : & str ) -> Result < ( ) > {
0 commit comments