Skip to content

Commit

Permalink
Trim Quotes from start, & end of log file (#1508)
Browse files Browse the repository at this point in the history
* Trim Quotes from start, & end of log file

* Use Path.Combine
  • Loading branch information
mayankbansal018 authored Mar 27, 2018
1 parent 9320fe1 commit 06e1058
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,17 @@ public void WriteLine(PlatformTraceLevel level, string message)
/// <inheritdoc/>
public bool InitializeVerboseTrace(string customLogFile)
{
LogFile = Path.GetTempPath() + Path.GetFileNameWithoutExtension(customLogFile).Replace(" ", "_") + ".TpTrace.log";
string logFileName = string.Empty;
try
{
logFileName = Path.GetFileNameWithoutExtension(customLogFile.TrimStart('"').TrimEnd('"')).Replace(" ", "_");
}
catch
{
logFileName = Guid.NewGuid().ToString();
}

LogFile = Path.Combine(Path.GetTempPath(), logFileName, ".TpTrace.log");
TraceLevel = PlatformTraceLevel.Verbose;

return this.TraceInitialized();
Expand Down

0 comments on commit 06e1058

Please sign in to comment.