From e4d1e0a40e89b3fb35bf3ee7a4c213919caae640 Mon Sep 17 00:00:00 2001 From: Zoryn Aaron Date: Sat, 26 Mar 2016 18:27:07 -0400 Subject: mid-update commit for resync --- StardewModdingAPI/Log.cs | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) (limited to 'StardewModdingAPI/Log.cs') diff --git a/StardewModdingAPI/Log.cs b/StardewModdingAPI/Log.cs index c6294194..6c338edc 100644 --- a/StardewModdingAPI/Log.cs +++ b/StardewModdingAPI/Log.cs @@ -32,15 +32,9 @@ namespace StardewModdingAPI } } - /// - /// Print provided parameters to the console/file as applicable - /// - /// Desired message - /// When true, writes to ONLY console and not the log file. - /// Additional params to be added to the message - private static void PrintLog(object message, bool disableLogging, params object[] values) + private static void PrintLog(object message, bool disableLogging) { - string logOutput = $"[{DateTime.Now.ToLongTimeString()}] {string.Format(message.ToString(), values)}"; + string logOutput = $"[{DateTime.Now.ToLongTimeString()}] {message?.ToString()}"; Console.WriteLine(logOutput); if (_logStream != null && !disableLogging) @@ -50,15 +44,26 @@ namespace StardewModdingAPI } } + /// + /// Print provided parameters to the console/file as applicable + /// + /// Desired message + /// When true, writes to ONLY console and not the log file. + /// Deprecated. Does nothing. + private static void PrintLog(object message, bool disableLogging, params object[] values) + { + PrintLog(message, disableLogging); + } + /// /// Successful message to display to console and logging. /// /// - /// + /// Deprecated. Do not use. public static void Success(object message, params object[] values) { Console.ForegroundColor = ConsoleColor.Green; - PrintLog(message?.ToString(), false, values); + PrintLog(message?.ToString(), false); Console.ForegroundColor = ConsoleColor.Gray; } @@ -66,11 +71,11 @@ namespace StardewModdingAPI /// Generic comment to display to console and logging. /// /// - /// + /// Deprecated. Do not use. public static void Verbose(object message, params object[] values) { Console.ForegroundColor = ConsoleColor.Gray; - PrintLog(message?.ToString(), false, values); + PrintLog(message?.ToString(), false); Console.ForegroundColor = ConsoleColor.Gray; } @@ -78,11 +83,11 @@ namespace StardewModdingAPI /// Additional comment to display to console and logging. /// /// - /// + /// Deprecated. Do not use. public static void Comment(object message, params object[] values) { Console.ForegroundColor = ConsoleColor.Yellow; - PrintLog(message?.ToString(), false, values); + PrintLog(message?.ToString(), false); Console.ForegroundColor = ConsoleColor.Gray; } @@ -90,11 +95,11 @@ namespace StardewModdingAPI /// Message for only console. Does not appear in logging. /// /// - /// + /// Deprecated. Do not use. public static void Info(object message, params object[] values) { Console.ForegroundColor = ConsoleColor.Gray; - PrintLog(message?.ToString(), true, values); + PrintLog(message?.ToString(), true); Console.ForegroundColor = ConsoleColor.Gray; } @@ -102,11 +107,11 @@ namespace StardewModdingAPI /// Important message indicating an error. /// /// - /// + /// Deprecated. Do not use. public static void Error(object message, params object[] values) { Console.ForegroundColor = ConsoleColor.Red; - PrintLog(message?.ToString(), false, values); + PrintLog(message?.ToString(), false); Console.ForegroundColor = ConsoleColor.Gray; } @@ -114,12 +119,12 @@ namespace StardewModdingAPI /// A message displayed only while in DEBUG mode /// /// - /// + /// Deprecated. Do not use. public static void Debug(object message, params object[] values) { #if DEBUG Console.ForegroundColor = ConsoleColor.Yellow; - Log.PrintLog(message.ToString(), false, values); + Log.PrintLog(message.ToString(), false); Console.ForegroundColor = ConsoleColor.Gray; #endif } -- cgit