Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1206,9 +1206,6 @@ internal string WrapToCurrentWindowWidth(string text)
/// </exception>
public override void WriteDebugLine(string message)
{
// don't lock here as WriteLine is already protected.
message = HostUtilities.RemoveGuidFromMessage(message, out _);

// We should write debug to error stream only if debug is redirected.)
if (_parent.ErrorFormat == Serialization.DataFormat.XML)
{
Expand Down Expand Up @@ -1266,9 +1263,6 @@ public override void WriteInformation(InformationRecord record)
/// </exception>
public override void WriteVerboseLine(string message)
{
// don't lock here as WriteLine is already protected.
message = HostUtilities.RemoveGuidFromMessage(message, out _);

// NTRAID#Windows OS Bugs-1061752-2004/12/15-sburns should read a skin setting here...)
if (_parent.ErrorFormat == Serialization.DataFormat.XML)
{
Expand Down Expand Up @@ -1309,9 +1303,6 @@ public override void WriteVerboseLine(string message)
/// </exception>
public override void WriteWarningLine(string message)
{
// don't lock here as WriteLine is already protected.
message = HostUtilities.RemoveGuidFromMessage(message, out _);

// NTRAID#Windows OS Bugs-1061752-2004/12/15-sburns should read a skin setting here...)
if (_parent.ErrorFormat == Serialization.DataFormat.XML)
{
Expand Down Expand Up @@ -1346,13 +1337,6 @@ public override void WriteProgress(long sourceId, ProgressRecord record)
return;
}

bool matchPattern;
string currentOperation = HostUtilities.RemoveIdentifierInfoFromMessage(record.CurrentOperation, out matchPattern);
if (matchPattern)
{
record = new ProgressRecord(record) { CurrentOperation = currentOperation };
}

// We allow only one thread at a time to update the progress state.)
if (_parent.ErrorFormat == Serialization.DataFormat.XML)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,48 +495,6 @@ internal static List<string> GetSuggestion(HistoryInfo lastHistory, object lastE
return returnSuggestions;
}

/// <summary>
/// Remove the GUID from the message if the message is in the pre-defined format.
/// </summary>
/// <param name="message"></param>
/// <param name="matchPattern"></param>
/// <returns></returns>
internal static string RemoveGuidFromMessage(string message, out bool matchPattern)
{
matchPattern = false;
if (string.IsNullOrEmpty(message))
return message;

const string pattern = @"^([\d\w]{8}\-[\d\w]{4}\-[\d\w]{4}\-[\d\w]{4}\-[\d\w]{12}:).*";
Match matchResult = Regex.Match(message, pattern);
if (matchResult.Success)
{
string partToRemove = matchResult.Groups[1].Captures[0].Value;
message = message.Remove(0, partToRemove.Length);
matchPattern = true;
}

return message;
}

internal static string RemoveIdentifierInfoFromMessage(string message, out bool matchPattern)
{
matchPattern = false;
if (string.IsNullOrEmpty(message))
return message;

const string pattern = @"^([\d\w]{8}\-[\d\w]{4}\-[\d\w]{4}\-[\d\w]{4}\-[\d\w]{12}:\[.*\]:).*";
Match matchResult = Regex.Match(message, pattern);
if (matchResult.Success)
{
string partToRemove = matchResult.Groups[1].Captures[0].Value;
message = message.Remove(0, partToRemove.Length);
matchPattern = true;
}

return message;
}

/// <summary>
/// Create suggestion with string rule and scriptblock suggestion.
/// </summary>
Expand Down