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

@@ -7,6 +7,7 @@ using System.Xml.Serialization;
using SabreTools.Library.Data;
using SabreTools.Library.FileTypes;
using SabreTools.Library.Filtering;
using SabreTools.Library.Logging;
using SabreTools.Library.Tools;
using NaturalSort;
using Newtonsoft.Json;
@@ -371,6 +372,16 @@ namespace SabreTools.Library.DatItems
#endregion
#endregion
#region Logging
/// <summary>
/// Logging object
/// </summary>
[JsonIgnore, XmlIgnore]
protected static Logger logger = new Logger();
#endregion
#region Instance Methods
@@ -1016,14 +1027,14 @@ namespace SabreTools.Library.DatItems
// If the current item exactly matches the last item, then we don't add it
if (datItem.GetDuplicateStatus(lastItem).HasFlag(DupeType.All))
{
Globals.Logger.Verbose($"Exact duplicate found for '{datItemName}'");
logger.Verbose($"Exact duplicate found for '{datItemName}'");
continue;
}
// If the current name matches the previous name, rename the current item
else if (datItemName == lastItemName)
{
Globals.Logger.Verbose($"Name duplicate found for '{datItemName}'");
logger.Verbose($"Name duplicate found for '{datItemName}'");
if (datItem.ItemType == ItemType.Disk || datItem.ItemType == ItemType.Media || datItem.ItemType == ItemType.Rom)
{