Support ChromeDriver "append log" flag in .NET
ChromeDriver has a command line option to append to existing log file
instead of overwriting it. Update .NET API to support it.
@@ -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.
@@ -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,
@@ -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);
