Skip to content

Commit

Permalink
console and logger is now singletons-ish (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
amazingalek authored Dec 30, 2019
1 parent f57a10e commit a0382e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions OWML.ModHelper/ModConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 3 additions & 0 deletions OWML.ModHelper/ModLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit a0382e3

Please sign in to comment.