Skip to content

Commit

Permalink
Support ChromeDriver "append log" flag in .NET
Browse files Browse the repository at this point in the history
ChromeDriver has a command line option to append to existing log file
instead of overwriting it. Update .NET API to support it.

Signed-off-by: Jim Evans <james.h.evans.jr@gmail.com>
  • Loading branch information
JohnChen0 authored and jimevans committed Jun 1, 2019
1 parent aa546c5 commit c29052b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions dotnet/src/webdriver/Chrome/ChromeDriverService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public sealed class ChromeDriverService : DriverService
private string whitelistedIpAddresses = string.Empty;
private int adbPort = -1;
private bool enableVerboseLogging;
private bool enableAppendLog;

/// <summary>
/// Initializes a new instance of the <see cref="ChromeDriverService"/> class.
Expand Down Expand Up @@ -95,6 +96,16 @@ public bool EnableVerboseLogging
set { this.enableVerboseLogging = value; }
}

/// <summary>
/// Gets or sets a value indicating whether to enable appending to an existing ChromeDriver log file.
/// Defaults to <see langword="false"/>.
/// </summary>
public bool EnableAppendLog
{
get { return this.enableAppendLog; }
set { this.enableAppendLog = value; }
}

/// <summary>
/// Gets or sets the comma-delimited list of IP addresses that are approved to
/// connect to this instance of the Chrome driver. Defaults to an empty string,
Expand Down Expand Up @@ -129,6 +140,11 @@ protected override string CommandLineArguments
argsBuilder.Append(" --verbose");
}

if (this.enableAppendLog)
{
argsBuilder.Append(" --append-log");
}

if (!string.IsNullOrEmpty(this.logPath))
{
argsBuilder.AppendFormat(CultureInfo.InvariantCulture, " --log-path=\"{0}\"", this.logPath);
Expand Down

0 comments on commit c29052b

Please sign in to comment.