diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-02-16 13:59:13 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-02-16 13:59:13 -0500 |
commit | 16c362f4c5949b463107e88b4b49e1e49cc395d7 (patch) | |
tree | 24121155137696a896511c7fbe631d686aba3f01 | |
parent | f8866ac4a81ad02f6f06391372ad1b32e6cfdb68 (diff) | |
download | SMAPI-16c362f4c5949b463107e88b4b49e1e49cc395d7.tar.gz SMAPI-16c362f4c5949b463107e88b4b49e1e49cc395d7.tar.bz2 SMAPI-16c362f4c5949b463107e88b4b49e1e49cc395d7.zip |
increase all notice deprecations to info, tweak deprecation message format
-rw-r--r-- | release-notes.md | 4 | ||||
-rw-r--r-- | src/StardewModdingAPI/Command.cs | 6 | ||||
-rw-r--r-- | src/StardewModdingAPI/Config.cs | 2 | ||||
-rw-r--r-- | src/StardewModdingAPI/Events/PlayerEvents.cs | 4 | ||||
-rw-r--r-- | src/StardewModdingAPI/Events/TimeEvents.cs | 2 | ||||
-rw-r--r-- | src/StardewModdingAPI/Framework/DeprecationManager.cs | 2 | ||||
-rw-r--r-- | src/StardewModdingAPI/Log.cs | 2 | ||||
-rw-r--r-- | src/StardewModdingAPI/Mod.cs | 6 | ||||
-rw-r--r-- | src/StardewModdingAPI/Program.cs | 2 |
9 files changed, 15 insertions, 15 deletions
diff --git a/release-notes.md b/release-notes.md index 98f527d2..8d571514 100644 --- a/release-notes.md +++ b/release-notes.md @@ -14,9 +14,9 @@ For mod developers: * Added `SaveEvents.AfterReturnToTitle` and `TimeEvents.AfterDayStarted` events. * Added a simpler API for console commands (see `helper.ConsoleCommands`). * Added `GetPrivateProperty` reflection helper. -* Many deprecated APIs have been removed; see the - [deprecation guide](http://canimod.com/guides/updating-a-smapi-mod) for more information. * Log files now always use `\r\n` to simplify crossplatform viewing. +* Several obsolete APIs have been removed (see [deprecation guide](http://canimod.com/guides/updating-a-smapi-mod)), + and all _notice_-level deprecations have been increased to _info_. For SMAPI developers: * Added support for debugging with Visual Studio for Mac. diff --git a/src/StardewModdingAPI/Command.cs b/src/StardewModdingAPI/Command.cs index 6b056ce7..e2d08538 100644 --- a/src/StardewModdingAPI/Command.cs +++ b/src/StardewModdingAPI/Command.cs @@ -94,7 +94,7 @@ namespace StardewModdingAPI /// <param name="monitor">Encapsulates monitoring and logging.</param> public static void CallCommand(string input, IMonitor monitor) { - Command.DeprecationManager.Warn("Command.CallCommand", "1.9", DeprecationLevel.Notice); + Command.DeprecationManager.Warn("Command.CallCommand", "1.9", DeprecationLevel.Info); Command.CommandManager.Trigger(input); } @@ -107,7 +107,7 @@ namespace StardewModdingAPI name = name?.Trim().ToLower(); // raise deprecation warning - Command.DeprecationManager.Warn("Command.RegisterCommand", "1.9", DeprecationLevel.Notice); + Command.DeprecationManager.Warn("Command.RegisterCommand", "1.9", DeprecationLevel.Info); // validate if (Command.LegacyCommands.ContainsKey(name)) @@ -130,7 +130,7 @@ namespace StardewModdingAPI /// <param name="name">The command name to find.</param> public static Command FindCommand(string name) { - Command.DeprecationManager.Warn("Command.FindCommand", "1.9", DeprecationLevel.Notice); + Command.DeprecationManager.Warn("Command.FindCommand", "1.9", DeprecationLevel.Info); if (name == null) return null; diff --git a/src/StardewModdingAPI/Config.cs b/src/StardewModdingAPI/Config.cs index f253930d..9f4bfad2 100644 --- a/src/StardewModdingAPI/Config.cs +++ b/src/StardewModdingAPI/Config.cs @@ -125,7 +125,7 @@ namespace StardewModdingAPI /// <summary>Construct an instance.</summary> protected Config() { - Config.DeprecationManager.Warn("the Config class", "1.0", DeprecationLevel.Notice); + Config.DeprecationManager.Warn("the Config class", "1.0", DeprecationLevel.Info); Config.DeprecationManager.MarkWarned($"{nameof(Mod)}.{nameof(Mod.BaseConfigPath)}", "1.0"); // typically used to construct config, avoid redundant warnings } } diff --git a/src/StardewModdingAPI/Events/PlayerEvents.cs b/src/StardewModdingAPI/Events/PlayerEvents.cs index 996077ab..b02ebfec 100644 --- a/src/StardewModdingAPI/Events/PlayerEvents.cs +++ b/src/StardewModdingAPI/Events/PlayerEvents.cs @@ -56,7 +56,7 @@ namespace StardewModdingAPI.Events string name = $"{nameof(PlayerEvents)}.{nameof(PlayerEvents.LoadedGame)}"; Delegate[] handlers = PlayerEvents.LoadedGame.GetInvocationList(); - PlayerEvents.DeprecationManager.WarnForEvent(handlers, name, "1.6", DeprecationLevel.Notice); + PlayerEvents.DeprecationManager.WarnForEvent(handlers, name, "1.6", DeprecationLevel.Info); monitor.SafelyRaiseGenericEvent(name, handlers, null, loaded); } @@ -72,7 +72,7 @@ namespace StardewModdingAPI.Events string name = $"{nameof(PlayerEvents)}.{nameof(PlayerEvents.FarmerChanged)}"; Delegate[] handlers = PlayerEvents.FarmerChanged.GetInvocationList(); - PlayerEvents.DeprecationManager.WarnForEvent(handlers, name, "1.6", DeprecationLevel.Notice); + PlayerEvents.DeprecationManager.WarnForEvent(handlers, name, "1.6", DeprecationLevel.Info); monitor.SafelyRaiseGenericEvent(name, handlers, null, new EventArgsFarmerChanged(priorFarmer, newFarmer)); } diff --git a/src/StardewModdingAPI/Events/TimeEvents.cs b/src/StardewModdingAPI/Events/TimeEvents.cs index 0f9257c1..3f06a46b 100644 --- a/src/StardewModdingAPI/Events/TimeEvents.cs +++ b/src/StardewModdingAPI/Events/TimeEvents.cs @@ -102,7 +102,7 @@ namespace StardewModdingAPI.Events string name = $"{nameof(TimeEvents)}.{nameof(TimeEvents.OnNewDay)}"; Delegate[] handlers = TimeEvents.OnNewDay.GetInvocationList(); - TimeEvents.DeprecationManager.WarnForEvent(handlers, name, "1.6", DeprecationLevel.Notice); + TimeEvents.DeprecationManager.WarnForEvent(handlers, name, "1.6", DeprecationLevel.Info); monitor.SafelyRaiseGenericEvent(name, handlers, null, new EventArgsNewDay(priorDay, newDay, isTransitioning)); } } diff --git a/src/StardewModdingAPI/Framework/DeprecationManager.cs b/src/StardewModdingAPI/Framework/DeprecationManager.cs index 8c32ba6a..e44cd369 100644 --- a/src/StardewModdingAPI/Framework/DeprecationManager.cs +++ b/src/StardewModdingAPI/Framework/DeprecationManager.cs @@ -70,7 +70,7 @@ namespace StardewModdingAPI.Framework break; case DeprecationLevel.Info: - this.Monitor.Log(message, LogLevel.Info); + this.Monitor.Log(message, LogLevel.Warn); break; case DeprecationLevel.PendingRemoval: diff --git a/src/StardewModdingAPI/Log.cs b/src/StardewModdingAPI/Log.cs index a8d78e55..d58cebfe 100644 --- a/src/StardewModdingAPI/Log.cs +++ b/src/StardewModdingAPI/Log.cs @@ -306,7 +306,7 @@ namespace StardewModdingAPI /// <summary>Raise a deprecation warning.</summary> private static void WarnDeprecated() { - Log.DeprecationManager.Warn($"the {nameof(Log)} class", "1.1", DeprecationLevel.Notice); + Log.DeprecationManager.Warn($"the {nameof(Log)} class", "1.1", DeprecationLevel.Info); } /// <summary>Get the name of the mod logging a message from the stack.</summary> diff --git a/src/StardewModdingAPI/Mod.cs b/src/StardewModdingAPI/Mod.cs index d3fe882f..44cfd4b3 100644 --- a/src/StardewModdingAPI/Mod.cs +++ b/src/StardewModdingAPI/Mod.cs @@ -35,7 +35,7 @@ namespace StardewModdingAPI { get { - Mod.DeprecationManager.Warn($"{nameof(Mod)}.{nameof(Mod.PathOnDisk)}", "1.0", DeprecationLevel.Notice); + Mod.DeprecationManager.Warn($"{nameof(Mod)}.{nameof(Mod.PathOnDisk)}", "1.0", DeprecationLevel.Info); return this._pathOnDisk; } internal set { this._pathOnDisk = value; } @@ -47,7 +47,7 @@ namespace StardewModdingAPI { get { - Mod.DeprecationManager.Warn($"{nameof(Mod)}.{nameof(Mod.BaseConfigPath)}", "1.0", DeprecationLevel.Notice); + Mod.DeprecationManager.Warn($"{nameof(Mod)}.{nameof(Mod.BaseConfigPath)}", "1.0", DeprecationLevel.Info); Mod.DeprecationManager.MarkWarned($"{nameof(Mod)}.{nameof(Mod.PathOnDisk)}", "1.0"); // avoid redundant warnings return Path.Combine(this.PathOnDisk, "config.json"); } @@ -96,7 +96,7 @@ namespace StardewModdingAPI [Obsolete] private string GetPerSaveConfigFolder() { - Mod.DeprecationManager.Warn($"{nameof(Mod)}.{nameof(Mod.PerSaveConfigFolder)}", "1.0", DeprecationLevel.Notice); + Mod.DeprecationManager.Warn($"{nameof(Mod)}.{nameof(Mod.PerSaveConfigFolder)}", "1.0", DeprecationLevel.Info); Mod.DeprecationManager.MarkWarned($"{nameof(Mod)}.{nameof(Mod.PathOnDisk)}", "1.0"); // avoid redundant warnings if (!((Manifest)this.ModManifest).PerSaveConfigs) diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs index ecc0360e..de07e8ad 100644 --- a/src/StardewModdingAPI/Program.cs +++ b/src/StardewModdingAPI/Program.cs @@ -552,7 +552,7 @@ namespace StardewModdingAPI // raise deprecation warning for old Entry() methods if (this.DeprecationManager.IsVirtualMethodImplemented(mod.GetType(), typeof(Mod), nameof(Mod.Entry), new[] { typeof(object[]) })) - this.DeprecationManager.Warn(mod.ModManifest.Name, $"{nameof(Mod)}.{nameof(Mod.Entry)}(object[]) instead of {nameof(Mod)}.{nameof(Mod.Entry)}({nameof(IModHelper)})", "1.0", DeprecationLevel.Notice); + this.DeprecationManager.Warn(mod.ModManifest.Name, $"{nameof(Mod)}.{nameof(Mod.Entry)}(object[]) instead of {nameof(Mod)}.{nameof(Mod.Entry)}({nameof(IModHelper)})", "1.0", DeprecationLevel.Info); } catch (Exception ex) { |