forked from amkovkov/GranuSightSoftware2
refactor: move Logging to GSS2.Core
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace GSS2.Core.Logging;
|
||||
|
||||
public sealed class FileLoggerProvider : ILoggerProvider
|
||||
{
|
||||
private readonly string _filePath;
|
||||
|
||||
public FileLoggerProvider(string filePath, bool append = true)
|
||||
{
|
||||
_filePath = filePath;
|
||||
if (!append && File.Exists(filePath))
|
||||
File.Create(filePath);
|
||||
}
|
||||
|
||||
public ILogger CreateLogger(string categoryName) => new FileLogger(categoryName, _filePath);
|
||||
|
||||
public void Dispose() { }
|
||||
}
|
||||
Reference in New Issue
Block a user