diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-11-14 22:25:36 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-11-14 22:25:36 -0500 |
commit | 54c0f26d5d6faaf71da4eb91bf28203390d79e71 (patch) | |
tree | f34ebb17da6182c7e44e4e1949b48e8df9484fc5 /src/StardewModdingAPI/Events/GameEvents.cs | |
parent | f54b4647921b04ce88b45bf90a33ae12e38fb77e (diff) | |
download | SMAPI-54c0f26d5d6faaf71da4eb91bf28203390d79e71.tar.gz SMAPI-54c0f26d5d6faaf71da4eb91bf28203390d79e71.tar.bz2 SMAPI-54c0f26d5d6faaf71da4eb91bf28203390d79e71.zip |
migrate game loop, events, and commands to new logging framework (#168)
Diffstat (limited to 'src/StardewModdingAPI/Events/GameEvents.cs')
-rw-r--r-- | src/StardewModdingAPI/Events/GameEvents.cs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/StardewModdingAPI/Events/GameEvents.cs b/src/StardewModdingAPI/Events/GameEvents.cs index e1bfc924..46505d14 100644 --- a/src/StardewModdingAPI/Events/GameEvents.cs +++ b/src/StardewModdingAPI/Events/GameEvents.cs @@ -52,7 +52,8 @@ namespace StardewModdingAPI.Events } /// <summary>Raise an <see cref="Initialize"/> event.</summary> - internal static void InvokeInitialize() + /// <param name="monitor">Encapsulates logging and monitoring.</param> + internal static void InvokeInitialize(IMonitor monitor) { try { @@ -60,12 +61,13 @@ namespace StardewModdingAPI.Events } catch (Exception ex) { - Log.Error($"A mod crashed handling an event.\n{ex}"); + monitor.Log($"A mod crashed handling an event.\n{ex}", LogLevel.Error); } } /// <summary>Raise a <see cref="LoadContent"/> event.</summary> - internal static void InvokeLoadContent() + /// <param name="monitor">Encapsulates logging and monitoring.</param> + internal static void InvokeLoadContent(IMonitor monitor) { try { @@ -73,12 +75,13 @@ namespace StardewModdingAPI.Events } catch (Exception ex) { - Log.Error($"A mod crashed handling an event.\n{ex}"); + monitor.Log($"A mod crashed handling an event.\n{ex}", LogLevel.Error); } } /// <summary>Raise an <see cref="UpdateTick"/> event.</summary> - internal static void InvokeUpdateTick() + /// <param name="monitor">Encapsulates logging and monitoring.</param> + internal static void InvokeUpdateTick(IMonitor monitor) { try { @@ -86,7 +89,7 @@ namespace StardewModdingAPI.Events } catch (Exception ex) { - Log.Error($"A mod crashed handling an event.\n{ex}"); + monitor.Log($"A mod crashed handling an event.\n{ex}", LogLevel.Error); } } |