Remove some old logging classes

This commit is contained in:
Alex Barney 2021-03-11 23:02:11 -07:00
parent 6e55d8c362
commit e2f1d74ae5
5 changed files with 0 additions and 91 deletions

View file

@ -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 = "");
}
}

View file

@ -1,16 +0,0 @@
using System;
using LibHac.FsSrv;
namespace LibHac.Fs
{
/// <summary>
/// The default access logger that will output to the SD card via <see cref="FileSystemProxyImpl"/>.
/// </summary>
public class SdCardAccessLog : IAccessLog
{
public void Log(Result result, System.TimeSpan startTime, System.TimeSpan endTime, int handleId, string message, string caller = "")
{
throw new NotImplementedException();
}
}
}

View file

@ -1,7 +0,0 @@
namespace LibHac
{
public interface ITimeSpanGenerator
{
System.TimeSpan GetCurrent();
}
}

View file

@ -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;
}
}
}

View file

@ -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));
}
}
}