diff options
Diffstat (limited to 'src/StardewModdingAPI/Log.cs')
-rw-r--r-- | src/StardewModdingAPI/Log.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/StardewModdingAPI/Log.cs b/src/StardewModdingAPI/Log.cs index 8923e10f..1ac20040 100644 --- a/src/StardewModdingAPI/Log.cs +++ b/src/StardewModdingAPI/Log.cs @@ -114,6 +114,13 @@ namespace StardewModdingAPI Log.AsyncColour(message?.ToString(), ConsoleColor.Magenta); } + /// <summary>Asynchronously log a warning to the console.</summary> + /// <param name="message">The message to log.</param> + public static void Warning(object message) + { + Log.AsyncY("[WARN] " + message); + } + /// <summary>Asynchronously log an error to the console.</summary> /// <param name="message">The message to log.</param> public static void Error(object message) @@ -142,6 +149,13 @@ namespace StardewModdingAPI Log.AsyncColour(message, ConsoleColor.DarkGray); } + /// <summary>Asynchronously log a message to the file that's not shown in the console.</summary> + /// <param name="message">The message to log.</param> + internal static void LogToFile(string message) + { + Task.Run(() => { Log.PrintLog(new LogInfo(message) { PrintConsole = false }); }); + } + /********* ** Private methods *********/ |