Instance logging with backing static class instead of Global

This commit is contained in:
Matt Nadareski
2020-10-07 15:42:30 -07:00
parent 348a2a2bcb
commit b7db9f7f14
69 changed files with 1034 additions and 834 deletions

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using SabreTools.Library.Data;
using SabreTools.Library.Logging;
using SabreTools.Library.Tools;
namespace SabreTools.Library.Filtering
@@ -16,6 +16,15 @@ namespace SabreTools.Library.Filtering
#endregion
#region Logging
/// <summary>
/// Logging object
/// </summary>
private Logger logger = new Logger();
#endregion
#region Extras Population
/// <summary>
@@ -31,7 +40,7 @@ namespace SabreTools.Library.Filtering
// If we don't even have a possible field and file combination
if (!input.Contains(":"))
{
Globals.Logger.Warning($"'{input}` is not a valid INI extras string. Valid INI extras strings are of the form 'key:value'. Please refer to README.1ST or the help feature for more details.");
logger.Warning($"'{input}` is not a valid INI extras string. Valid INI extras strings are of the form 'key:value'. Please refer to README.1ST or the help feature for more details.");
return;
}

View File

@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using SabreTools.Library.Data;
using SabreTools.Library.DatItems;
using SabreTools.Library.IO;
using SabreTools.Library.Logging;
namespace SabreTools.Library.Filtering
{
@@ -93,7 +93,7 @@ namespace SabreTools.Library.Filtering
}
catch (Exception ex)
{
Globals.Logger.Warning(ex, $"Exception found while parsing '{ini}'");
LoggerImpl.Warning(ex, $"Exception found while parsing '{ini}'");
return false;
}

View File

@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using SabreTools.Library.Data;
using SabreTools.Library.DatItems;
using SabreTools.Library.Logging;
using SabreTools.Library.Tools;
namespace SabreTools.Library.Filtering
@@ -286,6 +286,15 @@ namespace SabreTools.Library.Filtering
#endregion // Fields
#region Logging
/// <summary>
/// Logging object
/// </summary>
private Logger logger = new Logger();
#endregion
#region Instance methods
#region Filter Population
@@ -301,7 +310,7 @@ namespace SabreTools.Library.Filtering
// If we don't even have a possible filter pair
if (!filterPair.Contains(":"))
{
Globals.Logger.Warning($"'{filterPair}` is not a valid filter string. Valid filter strings are of the form 'key:value'. Please refer to README.1ST or the help feature for more details.");
logger.Warning($"'{filterPair}` is not a valid filter string. Valid filter strings are of the form 'key:value'. Please refer to README.1ST or the help feature for more details.");
continue;
}