mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Extract out Logging namespace
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -14,6 +14,8 @@
|
||||
/SabreTools.Help/obj/
|
||||
/SabreTools.Library/bin/
|
||||
/SabreTools.Library/obj/
|
||||
/SabreTools.Logging/bin/
|
||||
/SabreTools.Logging/obj/
|
||||
/SabreTools.Skippers/bin/
|
||||
/SabreTools.Skippers/obj/
|
||||
/SabreTools.userprefs
|
||||
|
||||
@@ -6,10 +6,10 @@ using System.Xml;
|
||||
|
||||
using SabreTools.Data;
|
||||
using SabreTools.Help;
|
||||
using SabreTools.Logging;
|
||||
using SabreTools.Library.DatFiles;
|
||||
using SabreTools.Library.DatItems;
|
||||
using SabreTools.Library.IO;
|
||||
using SabreTools.Library.Logging;
|
||||
using SabreTools.Library.Tools;
|
||||
using Microsoft.Data.Sqlite;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Collections.Generic;
|
||||
using RombaSharp.Features;
|
||||
using SabreTools.Data;
|
||||
using SabreTools.Help;
|
||||
using SabreTools.Library.Logging;
|
||||
using SabreTools.Logging;
|
||||
|
||||
namespace RombaSharp
|
||||
{
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SabreTools.Help\SabreTools.Help.csproj" />
|
||||
<ProjectReference Include="..\SabreTools.Library\SabreTools.Library.csproj" />
|
||||
<ProjectReference Include="..\SabreTools.Logging\SabreTools.Logging.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -11,4 +11,8 @@
|
||||
<DefineConstants>NET_FRAMEWORK</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SabreTools.Logging\SabreTools.Logging.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using SabreTools.Logging;
|
||||
|
||||
namespace SabreTools.Help
|
||||
{
|
||||
/// <summary>
|
||||
@@ -23,8 +25,7 @@ namespace SabreTools.Help
|
||||
/// <summary>
|
||||
/// Logging object
|
||||
/// </summary>
|
||||
// TODO: Re-enable all logging once Logging namespace separated out
|
||||
//private readonly Logger logger;
|
||||
private readonly Logger logger;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -35,7 +36,7 @@ namespace SabreTools.Help
|
||||
/// </summary>
|
||||
public TopLevel()
|
||||
{
|
||||
//logger = new Logger(this);
|
||||
logger = new Logger(this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -67,9 +68,9 @@ namespace SabreTools.Help
|
||||
// Everything else isn't a file
|
||||
else
|
||||
{
|
||||
//logger.Error($"Invalid input detected: {args[i]}");
|
||||
logger.Error($"Invalid input detected: {args[i]}");
|
||||
help.OutputIndividualFeature(this.Name);
|
||||
//LoggerImpl.Close();
|
||||
LoggerImpl.Close();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Data;
|
||||
using SabreTools.Logging;
|
||||
using SabreTools.Library.DatItems;
|
||||
using SabreTools.Library.FileTypes;
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.IO;
|
||||
using SabreTools.Library.Logging;
|
||||
using SabreTools.Library.Reports;
|
||||
using SabreTools.Library.Skippers;
|
||||
using SabreTools.Library.Tools;
|
||||
|
||||
@@ -9,9 +9,9 @@ using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Data;
|
||||
using SabreTools.Logging;
|
||||
using SabreTools.Library.DatItems;
|
||||
using SabreTools.Library.IO;
|
||||
using SabreTools.Library.Logging;
|
||||
using SabreTools.Library.Reports;
|
||||
using NaturalSort;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
@@ -5,9 +5,9 @@ using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Data;
|
||||
using SabreTools.Logging;
|
||||
using SabreTools.Library.FileTypes;
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Logging;
|
||||
using SabreTools.Library.Tools;
|
||||
using NaturalSort;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
@@ -3,9 +3,9 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
using SabreTools.Logging;
|
||||
using SabreTools.Library.DatItems;
|
||||
using SabreTools.Library.IO;
|
||||
using SabreTools.Library.Logging;
|
||||
using SabreTools.Library.Tools;
|
||||
|
||||
namespace SabreTools.Library.FileTypes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
using SabreTools.Library.Logging;
|
||||
using SabreTools.Logging;
|
||||
using SabreTools.Library.Tools;
|
||||
|
||||
namespace SabreTools.Library.Filtering
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using SabreTools.Logging;
|
||||
using SabreTools.Library.DatItems;
|
||||
using SabreTools.Library.IO;
|
||||
using SabreTools.Library.Logging;
|
||||
|
||||
namespace SabreTools.Library.Filtering
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using SabreTools.Logging;
|
||||
using SabreTools.Library.DatItems;
|
||||
using SabreTools.Library.Logging;
|
||||
using SabreTools.Library.Tools;
|
||||
|
||||
namespace SabreTools.Library.Filtering
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
using SabreTools.Library.Logging;
|
||||
using SabreTools.Logging;
|
||||
using NaturalSort;
|
||||
|
||||
namespace SabreTools.Library.IO
|
||||
|
||||
@@ -6,10 +6,9 @@ using System.Xml;
|
||||
using System.Xml.Schema;
|
||||
|
||||
using SabreTools.Data;
|
||||
using SabreTools.Logging;
|
||||
using SabreTools.Library.DatFiles;
|
||||
using SabreTools.Library.FileTypes;
|
||||
using SabreTools.Library.Logging;
|
||||
using SabreTools.Library.Tools;
|
||||
|
||||
namespace SabreTools.Library.IO
|
||||
{
|
||||
|
||||
@@ -5,9 +5,9 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using SabreTools.Data;
|
||||
using SabreTools.Logging;
|
||||
using SabreTools.Library.DatFiles;
|
||||
using SabreTools.Library.FileTypes;
|
||||
using SabreTools.Library.Logging;
|
||||
using SabreTools.Library.Tools;
|
||||
using Compress.ThreadReaders;
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using SabreTools.Data;
|
||||
using SabreTools.Logging;
|
||||
using SabreTools.Library.DatFiles;
|
||||
using SabreTools.Library.FileTypes;
|
||||
using SabreTools.Library.Logging;
|
||||
using SabreTools.Library.Skippers;
|
||||
using SabreTools.Library.Tools;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SabreTools.Data\SabreTools.Data.csproj" />
|
||||
<ProjectReference Include="..\SabreTools.Logging\SabreTools.Logging.csproj" />
|
||||
<ProjectReference Include="..\SabreTools.Skippers\SabreTools.Skippers.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -35,8 +36,4 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Help\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using SabreTools.Data;
|
||||
using SabreTools.Library.Logging;
|
||||
using SabreTools.Logging;
|
||||
using Microsoft.Data.Sqlite;
|
||||
|
||||
namespace SabreTools.Library.Tools
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
using SabreTools.Library.Logging;
|
||||
using SabreTools.Logging;
|
||||
|
||||
namespace SabreTools.Library.Tools
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace SabreTools.Library.Logging
|
||||
namespace SabreTools.Logging
|
||||
{
|
||||
/// <summary>
|
||||
/// Severity of the logging statement
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace SabreTools.Library.Logging
|
||||
namespace SabreTools.Logging
|
||||
{
|
||||
/// <summary>
|
||||
/// Generic delegate type for log events
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace SabreTools.Library.Logging
|
||||
namespace SabreTools.Logging
|
||||
{
|
||||
/// <summary>
|
||||
/// Per-class logging
|
||||
@@ -3,9 +3,8 @@ using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using SabreTools.Data;
|
||||
using SabreTools.Library.IO;
|
||||
|
||||
namespace SabreTools.Library.Logging
|
||||
namespace SabreTools.Logging
|
||||
{
|
||||
/// <summary>
|
||||
/// Internal logging implementation
|
||||
@@ -87,7 +86,7 @@ namespace SabreTools.Library.Logging
|
||||
{
|
||||
// Set and create the output
|
||||
if (addDate)
|
||||
Filename = $"{Path.GetFileNameWithoutExtension(filename)} ({DateTime.Now:yyyy-MM-dd HH-mm-ss}).{PathExtensions.GetNormalizedExtension(filename)}";
|
||||
Filename = $"{Path.GetFileNameWithoutExtension(filename)} ({DateTime.Now:yyyy-MM-dd HH-mm-ss}).{GetNormalizedExtension(filename)}";
|
||||
else
|
||||
Filename = filename;
|
||||
}
|
||||
@@ -112,7 +111,7 @@ namespace SabreTools.Library.Logging
|
||||
if (!string.IsNullOrEmpty(LogDirectory) && !Directory.Exists(LogDirectory))
|
||||
Directory.CreateDirectory(LogDirectory);
|
||||
|
||||
FileStream logfile = FileExtensions.TryCreate(Path.Combine(LogDirectory, Filename));
|
||||
FileStream logfile = TryCreate(Path.Combine(LogDirectory, Filename));
|
||||
_log = new StreamWriter(logfile, Encoding.UTF8, (int)(4 * Constants.KibiByte), true)
|
||||
{
|
||||
AutoFlush = true
|
||||
@@ -282,7 +281,7 @@ namespace SabreTools.Library.Logging
|
||||
/// <param name="ex">Exception to be written log</param>
|
||||
/// <param name="output">String to be written log</param>
|
||||
/// <returns>True if the output could be written, false otherwise</returns>
|
||||
internal static void Verbose(object instance, Exception ex, string output = null)
|
||||
public static void Verbose(object instance, Exception ex, string output = null)
|
||||
{
|
||||
LogEventHandler(instance, new LogEventArgs(LogLevel.VERBOSE, output, ex));
|
||||
}
|
||||
@@ -293,7 +292,7 @@ namespace SabreTools.Library.Logging
|
||||
/// <param name="instance">Instance object that's the source of logging</param>
|
||||
/// <param name="output">String to be written log</param>
|
||||
/// <returns>True if the output could be written, false otherwise</returns>
|
||||
internal static void Verbose(object instance, string output)
|
||||
public static void Verbose(object instance, string output)
|
||||
{
|
||||
LogEventHandler(instance, new LogEventArgs(LogLevel.VERBOSE, output, null));
|
||||
}
|
||||
@@ -305,7 +304,7 @@ namespace SabreTools.Library.Logging
|
||||
/// <param name="total">Total count for progress</param>
|
||||
/// <param name="current">Current count for progres</param>
|
||||
/// <param name="output">String to be written log</param>
|
||||
internal static void Verbose(object instance, long total, long current, string output = null)
|
||||
public static void Verbose(object instance, long total, long current, string output = null)
|
||||
{
|
||||
LogEventHandler(instance, new LogEventArgs(total, current, LogLevel.VERBOSE, output));
|
||||
}
|
||||
@@ -317,7 +316,7 @@ namespace SabreTools.Library.Logging
|
||||
/// <param name="ex">Exception to be written log</param>
|
||||
/// <param name="output">String to be written log</param>
|
||||
/// <returns>True if the output could be written, false otherwise</returns>
|
||||
internal static void User(object instance, Exception ex, string output = null)
|
||||
public static void User(object instance, Exception ex, string output = null)
|
||||
{
|
||||
LogEventHandler(instance, new LogEventArgs(LogLevel.USER, output, ex));
|
||||
}
|
||||
@@ -328,7 +327,7 @@ namespace SabreTools.Library.Logging
|
||||
/// <param name="instance">Instance object that's the source of logging</param>
|
||||
/// <param name="output">String to be written log</param>
|
||||
/// <returns>True if the output could be written, false otherwise</returns>
|
||||
internal static void User(object instance, string output)
|
||||
public static void User(object instance, string output)
|
||||
{
|
||||
LogEventHandler(instance, new LogEventArgs(LogLevel.USER, output, null));
|
||||
}
|
||||
@@ -340,7 +339,7 @@ namespace SabreTools.Library.Logging
|
||||
/// <param name="total">Total count for progress</param>
|
||||
/// <param name="current">Current count for progres</param>
|
||||
/// <param name="output">String to be written log</param>
|
||||
internal static void User(object instance, long total, long current, string output = null)
|
||||
public static void User(object instance, long total, long current, string output = null)
|
||||
{
|
||||
LogEventHandler(instance, new LogEventArgs(total, current, LogLevel.USER, output));
|
||||
}
|
||||
@@ -352,7 +351,7 @@ namespace SabreTools.Library.Logging
|
||||
/// <param name="ex">Exception to be written log</param>
|
||||
/// <param name="output">String to be written log</param>
|
||||
/// <returns>True if the output could be written, false otherwise</returns>
|
||||
internal static void Warning(object instance, Exception ex, string output = null)
|
||||
public static void Warning(object instance, Exception ex, string output = null)
|
||||
{
|
||||
LogEventHandler(instance, new LogEventArgs(LogLevel.WARNING, output, ex));
|
||||
}
|
||||
@@ -363,7 +362,7 @@ namespace SabreTools.Library.Logging
|
||||
/// <param name="instance">Instance object that's the source of logging</param>
|
||||
/// <param name="output">String to be written log</param>
|
||||
/// <returns>True if the output could be written, false otherwise</returns>
|
||||
internal static void Warning(object instance, string output)
|
||||
public static void Warning(object instance, string output)
|
||||
{
|
||||
LogEventHandler(instance, new LogEventArgs(LogLevel.WARNING, output, null));
|
||||
}
|
||||
@@ -375,7 +374,7 @@ namespace SabreTools.Library.Logging
|
||||
/// <param name="total">Total count for progress</param>
|
||||
/// <param name="current">Current count for progres</param>
|
||||
/// <param name="output">String to be written log</param>
|
||||
internal static void Warning(object instance, long total, long current, string output = null)
|
||||
public static void Warning(object instance, long total, long current, string output = null)
|
||||
{
|
||||
LogEventHandler(instance, new LogEventArgs(total, current, LogLevel.WARNING, output));
|
||||
}
|
||||
@@ -387,7 +386,7 @@ namespace SabreTools.Library.Logging
|
||||
/// <param name="ex">Exception to be written log</param>
|
||||
/// <param name="output">String to be written log</param>
|
||||
/// <returns>True if the output could be written, false otherwise</returns>
|
||||
internal static void Error(object instance, Exception ex, string output = null)
|
||||
public static void Error(object instance, Exception ex, string output = null)
|
||||
{
|
||||
LogEventHandler(instance, new LogEventArgs(LogLevel.ERROR, output, ex));
|
||||
}
|
||||
@@ -398,7 +397,7 @@ namespace SabreTools.Library.Logging
|
||||
/// <param name="instance">Instance object that's the source of logging</param>
|
||||
/// <param name="output">String to be written log</param>
|
||||
/// <returns>True if the output could be written, false otherwise</returns>
|
||||
internal static void Error(object instance, string output)
|
||||
public static void Error(object instance, string output)
|
||||
{
|
||||
LogEventHandler(instance, new LogEventArgs(LogLevel.ERROR, output, null));
|
||||
}
|
||||
@@ -410,11 +409,62 @@ namespace SabreTools.Library.Logging
|
||||
/// <param name="total">Total count for progress</param>
|
||||
/// <param name="current">Current count for progres</param>
|
||||
/// <param name="output">String to be written log</param>
|
||||
internal static void Error(object instance, long total, long current, string output = null)
|
||||
public static void Error(object instance, long total, long current, string output = null)
|
||||
{
|
||||
LogEventHandler(instance, new LogEventArgs(total, current, LogLevel.ERROR, output));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// TODO: Remove this region once IO namespace is separated out properly
|
||||
#region TEMPORARY - REMOVEME
|
||||
|
||||
/// <summary>
|
||||
/// Get the extension from the path, if possible
|
||||
/// </summary>
|
||||
/// <param name="path">Path to get extension from</param>
|
||||
/// <returns>Extension, if possible</returns>
|
||||
public static string GetNormalizedExtension(string path)
|
||||
{
|
||||
// Check null or empty first
|
||||
if (string.IsNullOrWhiteSpace(path))
|
||||
return null;
|
||||
|
||||
// Get the extension from the path, if possible
|
||||
string ext = Path.GetExtension(path)?.ToLowerInvariant();
|
||||
|
||||
// Check if the extension is null or empty
|
||||
if (string.IsNullOrWhiteSpace(ext))
|
||||
return null;
|
||||
|
||||
// Make sure that extensions are valid
|
||||
ext = ext.TrimStart('.');
|
||||
|
||||
return ext;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Try to create a file for write, optionally throwing the error
|
||||
/// </summary>
|
||||
/// <param name="file">Name of the file to create</param>
|
||||
/// <param name="throwOnError">True if the error that is thrown should be thrown back to the caller, false otherwise</param>
|
||||
/// <returns>An opened stream representing the file on success, null otherwise</returns>
|
||||
public static FileStream TryCreate(string file, bool throwOnError = false)
|
||||
{
|
||||
// Now wrap opening the file
|
||||
try
|
||||
{
|
||||
return File.Open(file, FileMode.Create, FileAccess.Write, FileShare.ReadWrite);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (throwOnError)
|
||||
throw ex;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
14
SabreTools.Logging/SabreTools - Backup.Logging.csproj
Normal file
14
SabreTools.Logging/SabreTools - Backup.Logging.csproj
Normal file
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net48;netcoreapp3.1;net5.0</TargetFrameworks>
|
||||
<RuntimeIdentifiers>win10-x64;win7-x86</RuntimeIdentifiers>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='net48'">
|
||||
<DefineConstants>NET_FRAMEWORK</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
18
SabreTools.Logging/SabreTools.Logging.csproj
Normal file
18
SabreTools.Logging/SabreTools.Logging.csproj
Normal file
@@ -0,0 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net48;netcoreapp3.1;net5.0</TargetFrameworks>
|
||||
<RuntimeIdentifiers>win10-x64;win7-x86</RuntimeIdentifiers>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)'=='net48'">
|
||||
<DefineConstants>NET_FRAMEWORK</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SabreTools.Data\SabreTools.Data.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net48;netcoreapp3.1;net5.0</TargetFrameworks>
|
||||
@@ -11,6 +11,10 @@
|
||||
<DefineConstants>NET_FRAMEWORK</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SabreTools.Logging\SabreTools.Logging.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="a7800.xml" />
|
||||
<None Remove="fds.xml" />
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using SabreTools.Logging;
|
||||
|
||||
namespace SabreTools.Library.Skippers
|
||||
{
|
||||
public class SkipperRule
|
||||
@@ -40,8 +42,7 @@ namespace SabreTools.Library.Skippers
|
||||
/// <summary>
|
||||
/// Logging object
|
||||
/// </summary>
|
||||
// TODO: Re-enable all logging once Logging namespace separated out
|
||||
//private readonly Logger logger;
|
||||
private readonly Logger logger;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -52,7 +53,7 @@ namespace SabreTools.Library.Skippers
|
||||
/// </summary>
|
||||
public SkipperRule()
|
||||
{
|
||||
//logger = new Logger(this);
|
||||
logger = new Logger(this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -85,7 +86,7 @@ namespace SabreTools.Library.Skippers
|
||||
// If the input file doesn't exist, fail
|
||||
if (!File.Exists(input))
|
||||
{
|
||||
//logger.Error($"I'm sorry but '{input}' doesn't exist!");
|
||||
logger.Error($"I'm sorry but '{input}' doesn't exist!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -123,7 +124,7 @@ namespace SabreTools.Library.Skippers
|
||||
|| (Operation > HeaderSkipOperation.Byteswap && (extsize % 4) != 0)
|
||||
|| (Operation > HeaderSkipOperation.Bitswap && (StartOffset == null || StartOffset % 2 == 0)))
|
||||
{
|
||||
//logger.Error("The stream did not have the correct size to be transformed!");
|
||||
logger.Error("The stream did not have the correct size to be transformed!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -132,7 +133,7 @@ namespace SabreTools.Library.Skippers
|
||||
BinaryReader br = null;
|
||||
try
|
||||
{
|
||||
//logger.User("Applying found rule to input stream");
|
||||
logger.User("Applying found rule to input stream");
|
||||
bw = new BinaryWriter(output);
|
||||
br = new BinaryReader(input);
|
||||
|
||||
@@ -220,7 +221,7 @@ namespace SabreTools.Library.Skippers
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//logger.Error(ex);
|
||||
logger.Error(ex);
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -22,6 +22,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.Skippers", "Sabr
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.Help", "SabreTools.Help\SabreTools.Help.csproj", "{55364167-844F-4B58-8280-F5327FA3D8E7}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.Logging", "SabreTools.Logging\SabreTools.Logging.csproj", "{3D54D896-19F0-4723-B1E3-E40FAFE5A078}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -78,6 +80,14 @@ Global
|
||||
{55364167-844F-4B58-8280-F5327FA3D8E7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{55364167-844F-4B58-8280-F5327FA3D8E7}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{55364167-844F-4B58-8280-F5327FA3D8E7}.Release|x64.Build.0 = Release|Any CPU
|
||||
{3D54D896-19F0-4723-B1E3-E40FAFE5A078}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3D54D896-19F0-4723-B1E3-E40FAFE5A078}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3D54D896-19F0-4723-B1E3-E40FAFE5A078}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{3D54D896-19F0-4723-B1E3-E40FAFE5A078}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{3D54D896-19F0-4723-B1E3-E40FAFE5A078}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3D54D896-19F0-4723-B1E3-E40FAFE5A078}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3D54D896-19F0-4723-B1E3-E40FAFE5A078}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{3D54D896-19F0-4723-B1E3-E40FAFE5A078}.Release|x64.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -3,11 +3,11 @@ using System.Collections.Generic;
|
||||
|
||||
using SabreTools.Data;
|
||||
using SabreTools.Help;
|
||||
using SabreTools.Logging;
|
||||
using SabreTools.Library.DatFiles;
|
||||
using SabreTools.Library.DatItems;
|
||||
using SabreTools.Library.FileTypes;
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Logging;
|
||||
using SabreTools.Library.Reports;
|
||||
using SabreTools.Library.Tools;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Collections.Generic;
|
||||
using SabreTools.Features;
|
||||
using SabreTools.Data;
|
||||
using SabreTools.Help;
|
||||
using SabreTools.Library.Logging;
|
||||
using SabreTools.Logging;
|
||||
|
||||
namespace SabreTools
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
@@ -15,6 +15,7 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SabreTools.Help\SabreTools.Help.csproj" />
|
||||
<ProjectReference Include="..\SabreTools.Library\SabreTools.Library.csproj" />
|
||||
<ProjectReference Include="..\SabreTools.Logging\SabreTools.Logging.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user