@@ -154,12 +154,6 @@ public int ProcessId
154154 /// </summary>
155155 public string ? DriverServicePath { get ; set ; }
156156
157- /// <summary>
158- /// Collects the driver log output and writes it to the console. Defaults to <see langword="true"/>.
159- /// Internal variable to avoid using the stream when logs are sent to a file.
160- /// </summary>
161- protected bool WriteDriverLogToConsole { get ; set ; } = true ;
162-
163157 /// <summary>
164158 /// Gets the command-line arguments for the driver service.
165159 /// </summary>
@@ -255,8 +249,8 @@ public void Start()
255249 this . driverServiceProcess . StartInfo . RedirectStandardOutput = true ;
256250 this . driverServiceProcess . StartInfo . RedirectStandardError = true ;
257251
258- this . driverServiceProcess . OutputDataReceived += ( s , e ) => this . OnDriverProcessDataReceived ( s , e , isError : false ) ;
259- this . driverServiceProcess . ErrorDataReceived += ( s , e ) => this . OnDriverProcessDataReceived ( s , e , isError : true ) ;
252+ this . driverServiceProcess . OutputDataReceived += this . OnDriverProcessDataReceived ;
253+ this . driverServiceProcess . ErrorDataReceived += this . OnDriverProcessDataReceived ;
260254
261255 DriverProcessStartingEventArgs eventArgs = new DriverProcessStartingEventArgs ( this . driverServiceProcess . StartInfo ) ;
262256 this . OnDriverProcessStarting ( eventArgs ) ;
@@ -332,18 +326,14 @@ protected virtual void OnDriverProcessStarted(DriverProcessStartedEventArgs even
332326 /// <param name="sender">The sender of the event.</param>
333327 /// <param name="args">The data received event arguments.</param>
334328 /// <param name="isError">A value indicating whether the data received is from the error stream.</param>
335- protected virtual void OnDriverProcessDataReceived ( object sender , DataReceivedEventArgs args , bool isError )
329+ protected virtual void OnDriverProcessDataReceived ( object sender , DataReceivedEventArgs args )
336330 {
337331 if ( string . IsNullOrEmpty ( args . Data ) )
338332 return ;
339333
340- if ( this . WriteDriverLogToConsole && ! isError && _logger . IsEnabled ( LogEventLevel . Info ) )
341- {
342- _logger . Info ( args . Data ) ;
343- }
344- if ( this . WriteDriverLogToConsole && isError && _logger . IsEnabled ( LogEventLevel . Error ) )
334+ if ( _logger . IsEnabled ( LogEventLevel . Trace ) )
345335 {
346- _logger . Error ( args . Data ) ;
336+ _logger . Trace ( args . Data ) ;
347337 }
348338 }
349339
0 commit comments