Skip to content

Commit

Permalink
No more unnecessary empty "stderr:" lines in log (#349)
Browse files Browse the repository at this point in the history
Many times stderr's contents are just a single newline; there's no need
to write that to the progress log. We also don't need to write double
newlines to the log, so trim the final trailing newline before writing.
  • Loading branch information
rmunn authored Sep 23, 2024
1 parent 4535fc4 commit 5263587
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/LibChorus/VcsDrivers/Mercurial/HgRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -702,13 +702,13 @@ private ExecutionResult ExecuteErrorsOk(string command, int secondsBeforeTimeout
{
throw new UserCancelledException();
}
if (!string.IsNullOrEmpty(result.StandardError))
if (!string.IsNullOrWhiteSpace(result.StandardError))
{
_progress.WriteVerbose("standerr: " + result.StandardError);//not necessarily an *error* down this deep
_progress.WriteVerbose("standerr: " + result.StandardError.TrimEnd());//not necessarily an *error* down this deep
}
if (!string.IsNullOrEmpty(result.StandardOutput))
if (!string.IsNullOrWhiteSpace(result.StandardOutput))
{
_progress.WriteVerbose("standout: " + result.StandardOutput);//not necessarily an *error* down this deep
_progress.WriteVerbose("standout: " + result.StandardOutput.TrimEnd());//not necessarily an *error* down this deep
}

#if DEBUG
Expand Down

0 comments on commit 5263587

Please sign in to comment.