diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-11-06 11:15:46 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-11-06 11:15:46 -0500 |
commit | 956e477edb515953e71d1cce1a728284f6ce3cc0 (patch) | |
tree | c24db349e8d9d9c42c0258b83a07aad217904984 /src/StardewModdingAPI/Framework | |
parent | e4d6cc138129153d654f43aabed16d2ba482beee (diff) | |
download | SMAPI-956e477edb515953e71d1cce1a728284f6ce3cc0.tar.gz SMAPI-956e477edb515953e71d1cce1a728284f6ce3cc0.tar.bz2 SMAPI-956e477edb515953e71d1cce1a728284f6ce3cc0.zip |
add developer mode which shows all deprecation warnings, update release process (#165)
Diffstat (limited to 'src/StardewModdingAPI/Framework')
-rw-r--r-- | src/StardewModdingAPI/Framework/DeprecationManager.cs | 12 | ||||
-rw-r--r-- | src/StardewModdingAPI/Framework/UserSettings.cs | 9 |
2 files changed, 20 insertions, 1 deletions
diff --git a/src/StardewModdingAPI/Framework/DeprecationManager.cs b/src/StardewModdingAPI/Framework/DeprecationManager.cs index a3d1ea41..0c5a49f9 100644 --- a/src/StardewModdingAPI/Framework/DeprecationManager.cs +++ b/src/StardewModdingAPI/Framework/DeprecationManager.cs @@ -19,6 +19,13 @@ namespace StardewModdingAPI.Framework /********* + ** Accessors + *********/ + /// <summary>Whether <see cref="DeprecationLevel.Notice"/>-level deprecation messages should be shown in the console.</summary> + public bool SendNoticesToConsole { get; set; } + + + /********* ** Public methods *********/ /// <summary>Register a mod as a possible source of deprecation warnings.</summary> @@ -63,7 +70,10 @@ namespace StardewModdingAPI.Framework switch (severity) { case DeprecationLevel.Notice: - Log.LogToFile(message); + if (this.SendNoticesToConsole) + Log.Debug($"[DEV] {message}"); + else + Log.LogToFile(message); break; case DeprecationLevel.Info: diff --git a/src/StardewModdingAPI/Framework/UserSettings.cs b/src/StardewModdingAPI/Framework/UserSettings.cs new file mode 100644 index 00000000..199d19b3 --- /dev/null +++ b/src/StardewModdingAPI/Framework/UserSettings.cs @@ -0,0 +1,9 @@ +namespace StardewModdingAPI.Framework +{ + /// <summary>Contains user settings from SMAPI's JSON configuration file.</summary> + internal class UserSettings + { + /// <summary>Whether to enable development features.</summary> + public bool DeveloperMode { get; set; } + } +} |