From 737a434ad6704d22776f463c192b9a9748ce2a21 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 29 Jul 2021 22:50:50 -0400 Subject: reduce ErrorHandler's direct references to internal SMAPI code That will allow removing the InternalsVisibleTo attribute to avoid namespace conflicts in an upcoming commit. --- src/SMAPI/Framework/SCore.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/SMAPI/Framework') diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 4211abc5..b607f95d 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Net; @@ -310,6 +311,14 @@ namespace StardewModdingAPI.Framework } } + /// Get the core logger and monitor on behalf of the game. + /// This method is called using reflection by the ErrorHandler mod to log game errors. + [SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "Used via reflection")] + public IMonitor GetMonitorForGame() + { + return this.LogManager.MonitorForGame; + } + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. public void Dispose() { -- cgit