Work on the datta handler
This commit is contained in:
@@ -1,13 +1,25 @@
|
||||
using SzCore;
|
||||
using SzCore.Defaults;
|
||||
|
||||
namespace SzCli;
|
||||
|
||||
public class Logger(ISzFileManager fileManager) : ISzLogger
|
||||
public class Logger : ISzLogger
|
||||
{
|
||||
private DefaultLocalFileManager _fileManager;
|
||||
public bool LogToFile { get; set; } = true;
|
||||
public string LogFilePath { get; set; } = Path.Combine(fileManager.DataPath, "log.txt");
|
||||
public string LogFilePath { get; set; }
|
||||
public int LogFileMaxLines { get; set; } = 100;
|
||||
|
||||
public Logger(DefaultLocalFileManager fm)
|
||||
{
|
||||
_fileManager = fm;
|
||||
LogFilePath = Path.Combine(_fileManager.DataPath, "log.txt");
|
||||
AppDomain.CurrentDomain.FirstChanceException += (sender, eventArgs) =>
|
||||
{
|
||||
LogError($"[EXCEPTION] {eventArgs.Exception}");
|
||||
};
|
||||
}
|
||||
|
||||
public void Log(string text)
|
||||
{
|
||||
Console.WriteLine($"{DateTime.UtcNow} : [SZ LOG] {text}");
|
||||
|
||||
Reference in New Issue
Block a user