fix console output during early game init not being logged

This doesn't affect any current output, it only affects test code.
This commit is contained in:
Jesse Plamondon-Willard 2018-11-09 18:52:24 -05:00
parent 9560baeb71
commit 10773c088a
No known key found for this signature in database
GPG Key ID: 7D7C8097B62033CE
1 changed files with 4 additions and 4 deletions

View File

@ -136,6 +136,10 @@ namespace StardewModdingAPI.Framework
this.EventManager = new EventManager(this.Monitor, this.ModRegistry);
this.DeprecationManager = new DeprecationManager(this.Monitor, this.ModRegistry);
// redirect direct console output
if (this.MonitorForGame.WriteToConsole)
this.ConsoleManager.OnMessageIntercepted += message => this.HandleConsoleMessage(this.MonitorForGame, message);
// inject deprecation managers
SemanticVersion.DeprecationManager = this.DeprecationManager;
@ -344,10 +348,6 @@ namespace StardewModdingAPI.Framework
/// <summary>Initialise SMAPI and mods after the game starts.</summary>
private void InitialiseAfterGameStart()
{
// redirect direct console output
if (this.MonitorForGame.WriteToConsole)
this.ConsoleManager.OnMessageIntercepted += message => this.HandleConsoleMessage(this.MonitorForGame, message);
// add headers
if (this.Settings.DeveloperMode)
this.Monitor.Log($"You configured SMAPI to run in developer mode. The console may be much more verbose. You can disable developer mode by installing the non-developer version of SMAPI, or by editing {Constants.ApiConfigPath}.", LogLevel.Info);