summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/InternalExtensions.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/InternalExtensions.cs')
-rw-r--r--src/SMAPI/Framework/InternalExtensions.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/InternalExtensions.cs b/src/SMAPI/Framework/InternalExtensions.cs
index 4cb77a45..fe10b045 100644
--- a/src/SMAPI/Framework/InternalExtensions.cs
+++ b/src/SMAPI/Framework/InternalExtensions.cs
@@ -45,6 +45,15 @@ namespace StardewModdingAPI.Framework
metadata.Monitor.Log(message, level);
}
+ /// <summary>Log a message using the mod's monitor, but only if it hasn't already been logged since the last game launch.</summary>
+ /// <param name="metadata">The mod whose monitor to use.</param>
+ /// <param name="message">The message to log.</param>
+ /// <param name="level">The log severity level.</param>
+ public static void LogAsModOnce(this IModMetadata metadata, string message, LogLevel level = LogLevel.Trace)
+ {
+ metadata.Monitor.LogOnce(message, level);
+ }
+
/****
** ManagedEvent
****/