From 90e92ef61f0808688abf638ee5cb941215c1586f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 14 Jan 2017 15:05:38 -0500 Subject: fix error when the console doesn't support colour (#206) --- src/StardewModdingAPI/LogWriter.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/StardewModdingAPI/LogWriter.cs') diff --git a/src/StardewModdingAPI/LogWriter.cs b/src/StardewModdingAPI/LogWriter.cs index 058fa649..9c2ef515 100644 --- a/src/StardewModdingAPI/LogWriter.cs +++ b/src/StardewModdingAPI/LogWriter.cs @@ -42,9 +42,14 @@ namespace StardewModdingAPI string output = $"[{message.LogTime}] {message.Message}"; if (message.PrintConsole) { - Console.ForegroundColor = message.Colour; - Console.WriteLine(message); - Console.ForegroundColor = ConsoleColor.Gray; + if (Monitor.ConsoleSupportsColor) + { + Console.ForegroundColor = message.Colour; + Console.WriteLine(message); + Console.ResetColor(); + } + else + Console.WriteLine(message); } this.LogFile.WriteLine(output); } -- cgit