diff options
-rw-r--r-- | release-notes.md | 2 | ||||
-rw-r--r-- | src/StardewModdingAPI/Log.cs | 106 |
2 files changed, 107 insertions, 1 deletions
diff --git a/release-notes.md b/release-notes.md index 91d6992d..65fe297e 100644 --- a/release-notes.md +++ b/release-notes.md @@ -7,7 +7,7 @@ For players: * Fixed console exiting immediately when some exceptions occur. * Fixed an error in 1.0 when mod uses `config.json` but the file doesn't exist. * Fixed critical errors being saved to a separate log file. - * Fixed compatibility with mods that use `Log.Out`.<sup>1.1.1</sup> + * Fixed compatibility with mods that use obsolete `Log` methods.<sup>1.1.1</sup> For developers: * Added new logging interface: diff --git a/src/StardewModdingAPI/Log.cs b/src/StardewModdingAPI/Log.cs index 3ab9fe78..5cb794f9 100644 --- a/src/StardewModdingAPI/Log.cs +++ b/src/StardewModdingAPI/Log.cs @@ -179,6 +179,112 @@ namespace StardewModdingAPI Log.Monitor.LegacyLog(Log.GetModName(), message, ConsoleColor.DarkGray, LogLevel.Trace); } + /// <summary>Obsolete.</summary> + public static void LogValueNotSpecified() + { + Log.WarnDeprecated(); + Log.AsyncR("<value> must be specified"); + } + + /// <summary>Obsolete.</summary> + public static void LogObjectValueNotSpecified() + { + Log.WarnDeprecated(); + Log.AsyncR("<object> and <value> must be specified"); + } + + /// <summary>Obsolete.</summary> + public static void LogValueInvalid() + { + Log.WarnDeprecated(); + Log.AsyncR("<value> is invalid"); + } + + /// <summary>Obsolete.</summary> + public static void LogObjectInvalid() + { + Log.WarnDeprecated(); + Log.AsyncR("<object> is invalid"); + } + + /// <summary>Obsolete.</summary> + public static void LogValueNotInt32() + { + Log.WarnDeprecated(); + Log.AsyncR("<value> must be a whole number (Int32)"); + } + + /// <summary>Obsolete.</summary> + /// <param name="message">The message to log.</param> + /// <param name="disableLogging">Obsolete.</param> + /// <param name="values">Obsolete.</param> + [Obsolete("Parameter 'values' is no longer supported. Format before logging.")] + private static void PrintLog(object message, bool disableLogging, params object[] values) + { + Log.WarnDeprecated(); + Log.Monitor.LegacyLog(Log.GetModName(), message?.ToString(), ConsoleColor.Gray); + } + + /// <summary>Obsolete.</summary> + /// <param name="message">The message to log.</param> + /// <param name="values">Obsolete.</param> + [Obsolete("Parameter 'values' is no longer supported. Format before logging.")] + public static void Success(object message, params object[] values) + { + Log.WarnDeprecated(); + Log.Success(message); + } + + /// <summary>Obsolete.</summary> + /// <param name="message">The message to log.</param> + /// <param name="values">Obsolete.</param> + [Obsolete("Parameter 'values' is no longer supported. Format before logging.")] + public static void Verbose(object message, params object[] values) + { + Log.WarnDeprecated(); + Log.Out(message); + } + + /// <summary>Obsolete.</summary> + /// <param name="message">The message to log.</param> + /// <param name="values">Obsolete.</param> + [Obsolete("Parameter 'values' is no longer supported. Format before logging.")] + public static void Comment(object message, params object[] values) + { + Log.WarnDeprecated(); + Log.AsyncC(message); + } + + /// <summary>Obsolete.</summary> + /// <param name="message">The message to log.</param> + /// <param name="values">Obsolete.</param> + [Obsolete("Parameter 'values' is no longer supported. Format before logging.")] + public static void Info(object message, params object[] values) + { + Log.WarnDeprecated(); + Log.Info(message); + } + + /// <summary>Obsolete.</summary> + /// <param name="message">The message to log.</param> + /// <param name="values">Obsolete.</param> + [Obsolete("Parameter 'values' is no longer supported. Format before logging.")] + public static void Error(object message, params object[] values) + { + Log.WarnDeprecated(); + Log.Error(message); + } + + /// <summary>Obsolete.</summary> + /// <param name="message">The message to log.</param> + /// <param name="values">Obsolete.</param> + [Obsolete("Parameter 'values' is no longer supported. Format before logging.")] + public static void Debug(object message, params object[] values) + { + Log.WarnDeprecated(); + Log.Debug(message); + } + /********* ** Private methods |