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
|
#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>
|
/// <summary>
|
||||||
/// Prefixes the given data with an ANSI control sequence and suffixes with a reset sequence.
|
/// Prefixes the given data with an ANSI control sequence and suffixes with a reset sequence.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ namespace ICD.Common.Utils
|
|||||||
if (IcdEnvironment.CrestronRuntimeEnvironment != IcdEnvironment.eCrestronRuntimeEnvironment.Server)
|
if (IcdEnvironment.CrestronRuntimeEnvironment != IcdEnvironment.eCrestronRuntimeEnvironment.Server)
|
||||||
CrestronConsole.PrintLine(fixedMessage);
|
CrestronConsole.PrintLine(fixedMessage);
|
||||||
#else
|
#else
|
||||||
|
Trace.WriteLine(AnsiUtils.StripAnsi(fixedMessage));
|
||||||
Console.WriteLine(fixedMessage);
|
Console.WriteLine(fixedMessage);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -132,7 +133,8 @@ namespace ICD.Common.Utils
|
|||||||
if (IcdEnvironment.CrestronRuntimeEnvironment != IcdEnvironment.eCrestronRuntimeEnvironment.Server)
|
if (IcdEnvironment.CrestronRuntimeEnvironment != IcdEnvironment.eCrestronRuntimeEnvironment.Server)
|
||||||
CrestronConsole.Print(fixedMessage);
|
CrestronConsole.Print(fixedMessage);
|
||||||
#else
|
#else
|
||||||
Console.Write(message);
|
Trace.Write(AnsiUtils.StripAnsi(fixedMessage));
|
||||||
|
Console.Write(fixedMessage);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
Reference in New Issue
Block a user