From e2f1d74ae52b4d4754c93c20b00107704cf8c98d Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Thu, 11 Mar 2021 23:02:11 -0700 Subject: [PATCH] Remove some old logging classes --- src/LibHac/Fs/IAccessLog.cs | 9 ----- src/LibHac/Fs/SdCardAccessLog.cs | 16 --------- src/LibHac/ITimeSpanGenerator.cs | 7 ---- src/LibHac/StopWatchTimeSpanGenerator.cs | 14 -------- src/hactoolnet/AccessLog.cs | 45 ------------------------ 5 files changed, 91 deletions(-) delete mode 100644 src/LibHac/Fs/IAccessLog.cs delete mode 100644 src/LibHac/Fs/SdCardAccessLog.cs delete mode 100644 src/LibHac/ITimeSpanGenerator.cs delete mode 100644 src/LibHac/StopWatchTimeSpanGenerator.cs delete mode 100644 src/hactoolnet/AccessLog.cs diff --git a/src/LibHac/Fs/IAccessLog.cs b/src/LibHac/Fs/IAccessLog.cs deleted file mode 100644 index f725f509..00000000 --- a/src/LibHac/Fs/IAccessLog.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace LibHac.Fs -{ - public interface IAccessLog - { - void Log(Result result, System.TimeSpan startTime, System.TimeSpan endTime, int handleId, string message, [CallerMemberName] string caller = ""); - } -} \ No newline at end of file diff --git a/src/LibHac/Fs/SdCardAccessLog.cs b/src/LibHac/Fs/SdCardAccessLog.cs deleted file mode 100644 index 5cfa88d5..00000000 --- a/src/LibHac/Fs/SdCardAccessLog.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using LibHac.FsSrv; - -namespace LibHac.Fs -{ - /// - /// The default access logger that will output to the SD card via . - /// - public class SdCardAccessLog : IAccessLog - { - public void Log(Result result, System.TimeSpan startTime, System.TimeSpan endTime, int handleId, string message, string caller = "") - { - throw new NotImplementedException(); - } - } -} diff --git a/src/LibHac/ITimeSpanGenerator.cs b/src/LibHac/ITimeSpanGenerator.cs deleted file mode 100644 index cd06835d..00000000 --- a/src/LibHac/ITimeSpanGenerator.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace LibHac -{ - public interface ITimeSpanGenerator - { - System.TimeSpan GetCurrent(); - } -} \ No newline at end of file diff --git a/src/LibHac/StopWatchTimeSpanGenerator.cs b/src/LibHac/StopWatchTimeSpanGenerator.cs deleted file mode 100644 index 439f0616..00000000 --- a/src/LibHac/StopWatchTimeSpanGenerator.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Diagnostics; - -namespace LibHac -{ - public class StopWatchTimeSpanGenerator : ITimeSpanGenerator - { - private Stopwatch Timer = Stopwatch.StartNew(); - - public System.TimeSpan GetCurrent() - { - return Timer.Elapsed; - } - } -} diff --git a/src/hactoolnet/AccessLog.cs b/src/hactoolnet/AccessLog.cs deleted file mode 100644 index d61f56e0..00000000 --- a/src/hactoolnet/AccessLog.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.IO; -using System.Runtime.CompilerServices; -using LibHac; -using LibHac.Fs; - -namespace hactoolnet -{ - public class ConsoleAccessLog : IAccessLog - { - public void Log(Result result, System.TimeSpan startTime, System.TimeSpan endTime, int handleId, string message, [CallerMemberName] string caller = "") - { - Console.WriteLine(AccessLogHelpers.BuildDefaultLogLine(result, startTime, endTime, handleId, message, caller)); - } - } - - public class ProgressReportAccessLog : IAccessLog - { - private IProgressReport Logger { get; } - public ProgressReportAccessLog(IProgressReport logger) - { - Logger = logger; - } - - public void Log(Result result, System.TimeSpan startTime, System.TimeSpan endTime, int handleId, string message, [CallerMemberName] string caller = "") - { - Logger.LogMessage(AccessLogHelpers.BuildDefaultLogLine(result, startTime, endTime, handleId, message, caller)); - } - } - - public class TextWriterAccessLog : IAccessLog - { - private TextWriter Logger { get; } - - public TextWriterAccessLog(TextWriter logger) - { - Logger = logger; - } - - public void Log(Result result, System.TimeSpan startTime, System.TimeSpan endTime, int handleId, string message, [CallerMemberName] string caller = "") - { - Logger.WriteLine(AccessLogHelpers.BuildDefaultLogLine(result, startTime, endTime, handleId, message, caller)); - } - } -}