diff --git a/ICD.Common.Utils/AnsiUtils.cs b/ICD.Common.Utils/AnsiUtils.cs
index a59f2a1..11e62ae 100644
--- a/ICD.Common.Utils/AnsiUtils.cs
+++ b/ICD.Common.Utils/AnsiUtils.cs
@@ -81,6 +81,16 @@ namespace ICD.Common.Utils
#endif
}
+ ///
+ /// Removes ANSI control sequences from the string.
+ ///
+ ///
+ ///
+ public static string StripAnsi(string data)
+ {
+ return Regex.Replace(data, ANSI_REGEX, string.Empty);
+ }
+
///
/// Prefixes the given data with an ANSI control sequence and suffixes with a reset sequence.
///
diff --git a/ICD.Common.Utils/IcdConsole.cs b/ICD.Common.Utils/IcdConsole.cs
index 1edbc2b..7bb8362 100644
--- a/ICD.Common.Utils/IcdConsole.cs
+++ b/ICD.Common.Utils/IcdConsole.cs
@@ -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