summaryrefslogtreecommitdiff
path: root/src/SMAPI/IMonitor.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-10-14 11:44:02 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-10-14 11:44:02 -0400
commit79118316065a01322d8ea12a14589ec016794c32 (patch)
tree7a26668a66ea0630a2b9367ac820fe7a6d99ac77 /src/SMAPI/IMonitor.cs
parentaf1a2bde8219c5d4b8660b13702725626a4a5647 (diff)
parent8aec1eff99858716afe7b8604b512181f78c214f (diff)
downloadSMAPI-79118316065a01322d8ea12a14589ec016794c32.tar.gz
SMAPI-79118316065a01322d8ea12a14589ec016794c32.tar.bz2
SMAPI-79118316065a01322d8ea12a14589ec016794c32.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/IMonitor.cs')
-rw-r--r--src/SMAPI/IMonitor.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/SMAPI/IMonitor.cs b/src/SMAPI/IMonitor.cs
new file mode 100644
index 00000000..62c479bc
--- /dev/null
+++ b/src/SMAPI/IMonitor.cs
@@ -0,0 +1,25 @@
+namespace StardewModdingAPI
+{
+ /// <summary>Encapsulates monitoring and logging for a given module.</summary>
+ public interface IMonitor
+ {
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>Whether SMAPI is aborting. Mods don't need to worry about this unless they have background tasks.</summary>
+ bool IsExiting { get; }
+
+
+ /*********
+ ** Methods
+ *********/
+ /// <summary>Log a message for the player or developer.</summary>
+ /// <param name="message">The message to log.</param>
+ /// <param name="level">The log severity level.</param>
+ void Log(string message, LogLevel level = LogLevel.Debug);
+
+ /// <summary>Immediately exit the game without saving. This should only be invoked when an irrecoverable fatal error happens that risks save corruption or game-breaking bugs.</summary>
+ /// <param name="reason">The reason for the shutdown.</param>
+ void ExitGameImmediately(string reason);
+ }
+}