mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-01-11 19:44:55 +00:00
feat: IcdConsole traces to Visual Studio output
This commit is contained in:
@@ -81,6 +81,16 @@ namespace ICD.Common.Utils
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes ANSI control sequences from the string.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
public static string StripAnsi(string data)
|
||||
{
|
||||
return Regex.Replace(data, ANSI_REGEX, string.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prefixes the given data with an ANSI control sequence and suffixes with a reset sequence.
|
||||
/// </summary>
|
||||
|
||||
@@ -91,6 +91,7 @@ namespace ICD.Common.Utils
|
||||
if (IcdEnvironment.CrestronRuntimeEnvironment != IcdEnvironment.eCrestronRuntimeEnvironment.Server)
|
||||
CrestronConsole.PrintLine(fixedMessage);
|
||||
#else
|
||||
Trace.WriteLine(AnsiUtils.StripAnsi(fixedMessage));
|
||||
Console.WriteLine(fixedMessage);
|
||||
#endif
|
||||
}
|
||||
@@ -132,7 +133,8 @@ namespace ICD.Common.Utils
|
||||
if (IcdEnvironment.CrestronRuntimeEnvironment != IcdEnvironment.eCrestronRuntimeEnvironment.Server)
|
||||
CrestronConsole.Print(fixedMessage);
|
||||
#else
|
||||
Console.Write(message);
|
||||
Trace.Write(AnsiUtils.StripAnsi(fixedMessage));
|
||||
Console.Write(fixedMessage);
|
||||
#endif
|
||||
}
|
||||
finally
|
||||
|
||||
Reference in New Issue
Block a user