From 95a93a05b39d2b27b538ecdb0e6a18f28096c5c2 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 7 Feb 2017 20:50:41 -0500 Subject: remove oldest deprecated code (#231) Since Stardew Valley 1.2 breaks most mods anyway, this commits removes the oldest deprecations and fixes the issues that are easiest for mods to update. See documentation for details. --- src/StardewModdingAPI/LogWriter.cs | 66 -------------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 src/StardewModdingAPI/LogWriter.cs (limited to 'src/StardewModdingAPI/LogWriter.cs') diff --git a/src/StardewModdingAPI/LogWriter.cs b/src/StardewModdingAPI/LogWriter.cs deleted file mode 100644 index e22759a7..00000000 --- a/src/StardewModdingAPI/LogWriter.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using StardewModdingAPI.Framework; - -namespace StardewModdingAPI -{ - /// A log writer which queues messages for output, and periodically flushes them to the console and log file. - /// Only one instance should be created. - [Obsolete("This class is internal and should not be referenced outside SMAPI. It will no longer be exposed in a future version.")] - public class LogWriter - { - /********* - ** Properties - *********/ - /// Manages reading and writing to the log file. - private readonly LogFileManager LogFile; - - - /********* - ** Public methods - *********/ - /// Construct an instance. - /// Manages reading and writing to the log file. - internal LogWriter(LogFileManager logFile) - { - this.WarnDeprecated(); - this.LogFile = logFile; - } - - /// Queue a message for output. - /// The message to log. - public void WriteToLog(string message) - { - this.WarnDeprecated(); - this.WriteToLog(new LogInfo(message)); - } - - /// Queue a message for output. - /// The message to log. - public void WriteToLog(LogInfo message) - { - this.WarnDeprecated(); - string output = $"[{message.LogTime}] {message.Message}"; - if (message.PrintConsole) - { - if (Monitor.ConsoleSupportsColor) - { - Console.ForegroundColor = message.Colour; - Console.WriteLine(message); - Console.ResetColor(); - } - else - Console.WriteLine(message); - } - this.LogFile.WriteLine(output); - } - - /********* - ** Private methods - *********/ - /// Raise a deprecation warning. - private void WarnDeprecated() - { - Program.DeprecationManager.Warn($"the {nameof(LogWriter)} class", "1.0", DeprecationLevel.PendingRemoval); - } - } -} \ No newline at end of file -- cgit