feat: added loggers
This commit is contained in:
20
Engine.Core/Debug/FileLogger.cs
Normal file
20
Engine.Core/Debug/FileLogger.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Syntriax.Engine.Core.Debug;
|
||||
|
||||
public class FileLogger : LoggerBase
|
||||
{
|
||||
public readonly string FilePath;
|
||||
|
||||
public FileLogger(string filePath)
|
||||
{
|
||||
FilePath = filePath;
|
||||
File.Open(filePath, FileMode.Create).Close();
|
||||
}
|
||||
|
||||
protected override void Write(string message)
|
||||
{
|
||||
File.AppendAllTextAsync(FilePath, $"{message}{Environment.NewLine}");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user