From a0382e300ee7f11bb283e68474e7ef92a128d82c Mon Sep 17 00:00:00 2001 From: amazingalek Date: Mon, 30 Dec 2019 13:48:08 +0100 Subject: [PATCH] console and logger is now singletons-ish (#35) --- OWML.ModHelper/ModConsole.cs | 3 +++ OWML.ModHelper/ModLogger.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/OWML.ModHelper/ModConsole.cs b/OWML.ModHelper/ModConsole.cs index 1e997cd27..881575cd7 100644 --- a/OWML.ModHelper/ModConsole.cs +++ b/OWML.ModHelper/ModConsole.cs @@ -7,11 +7,14 @@ namespace OWML.ModHelper { public class ModConsole : IModConsole { + public static ModConsole Instance { get; private set; } + private readonly FileStream _writer; private readonly IModLogger _logger; public ModConsole(IModConfig config, IModLogger logger) { + Instance = this; _logger = logger; _writer = File.Open(config.OutputFilePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite); } diff --git a/OWML.ModHelper/ModLogger.cs b/OWML.ModHelper/ModLogger.cs index 5dff1e519..b020e708b 100644 --- a/OWML.ModHelper/ModLogger.cs +++ b/OWML.ModHelper/ModLogger.cs @@ -6,10 +6,13 @@ namespace OWML.ModHelper { public class ModLogger : IModLogger { + public static ModLogger Instance { get; private set; } + private readonly IModConfig _config; public ModLogger(IModConfig config) { + Instance = this; _config = config; }