diff options
author | Zoryn Aaron <zoryn4163@gmail.com> | 2016-03-27 19:22:26 -0400 |
---|---|---|
committer | Zoryn Aaron <zoryn4163@gmail.com> | 2016-03-27 19:22:26 -0400 |
commit | 106ccd0d8760350d10054aab1c35cc6e71ef322b (patch) | |
tree | 84e38a6710dc7d55f137af85b4fda97f3b11e061 /StardewModdingAPI | |
parent | bcaa3fc7a435f462c0acbb1bcd55f061e4f5aa9c (diff) | |
download | SMAPI-106ccd0d8760350d10054aab1c35cc6e71ef322b.tar.gz SMAPI-106ccd0d8760350d10054aab1c35cc6e71ef322b.tar.bz2 SMAPI-106ccd0d8760350d10054aab1c35cc6e71ef322b.zip |
logging
Diffstat (limited to 'StardewModdingAPI')
-rw-r--r-- | StardewModdingAPI/Logger.cs | 52 |
1 files changed, 38 insertions, 14 deletions
diff --git a/StardewModdingAPI/Logger.cs b/StardewModdingAPI/Logger.cs index 35903513..68638cb5 100644 --- a/StardewModdingAPI/Logger.cs +++ b/StardewModdingAPI/Logger.cs @@ -21,19 +21,7 @@ namespace StardewModdingAPI _writer.WriteToLog(li); } - #region Sync Logging - - /// <summary> - /// NOTICE: Sync logging is discouraged. Please use Async instead. - /// </summary> - /// <param name="message">Message to log</param> - /// <param name="colour">Colour of message</param> - public static void SyncColour(object message, ConsoleColor colour) - { - PrintLog(new LogInfo(message?.ToString(), colour)); - } - - #endregion + #region Exception Logging /// <summary> /// Catch unhandled exception from the application @@ -55,6 +43,22 @@ namespace StardewModdingAPI File.WriteAllText(Constants.LogDir + "\\MODDED_ErrorLog.Log_" + Extensions.Random.Next(100000000, 999999999) + ".txt", e.Exception.ToString()); } + #endregion + + #region Sync Logging + + /// <summary> + /// NOTICE: Sync logging is discouraged. Please use Async instead. + /// </summary> + /// <param name="message">Message to log</param> + /// <param name="colour">Colour of message</param> + public static void SyncColour(object message, ConsoleColor colour) + { + PrintLog(new LogInfo(message?.ToString(), colour)); + } + + #endregion + #region Async Logging public static void AsyncColour(object message, ConsoleColor colour) @@ -97,6 +101,26 @@ namespace StardewModdingAPI AsyncColour(message?.ToString(), ConsoleColor.Magenta); } + public static void Error(object message) + { + AsyncR("[ERROR] " + message); + } + + public static void Success(object message) + { + AsyncG("[SUCCESS] " + message); + } + + public static void Info(object message) + { + AsyncY("[INFO] " + message); + } + + public static void Out(object message) + { + Async("[OUT] " + message); + } + #endregion #region ToRemove @@ -157,7 +181,7 @@ namespace StardewModdingAPI } [Obsolete("Parameter 'values' is no longer supported. Format before logging.")] - public static void AsyncR(object message, params object[] values) + public static void Error(object message, params object[] values) { AsyncR(message); } |