File tree Expand file tree Collapse file tree
src/OpenTelemetry.Exporter.Console Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,12 +64,12 @@ public override ExportResult Export(in Batch<T> batch)
6464 continue ;
6565 }
6666
67- Console . Write ( $ " { tag . Key } : [") ;
67+ this . Write ( $ " { tag . Key } : [") ;
6868
6969 for ( int i = 0 ; i < array . Length ; i ++ )
7070 {
71- Console . Write ( i != 0 ? ", " : string . Empty ) ;
72- Console . Write ( $ "{ array . GetValue ( i ) } ") ;
71+ this . Write ( i != 0 ? ", " : string . Empty ) ;
72+ this . Write ( $ "{ array . GetValue ( i ) } ") ;
7373 }
7474
7575 this . WriteLine ( $ "]") ;
@@ -151,5 +151,18 @@ private void WriteLine(string message)
151151 Debug . WriteLine ( message ) ;
152152 }
153153 }
154+
155+ private void Write ( string message )
156+ {
157+ if ( this . options . Targets . HasFlag ( ConsoleExporterOutputTargets . Console ) )
158+ {
159+ Console . Write ( message ) ;
160+ }
161+
162+ if ( this . options . Targets . HasFlag ( ConsoleExporterOutputTargets . Debug ) )
163+ {
164+ Debug . Write ( message ) ;
165+ }
166+ }
154167 }
155168}
You can’t perform that action at this time.
0 commit comments