mirror of
https://github.com/C9Glax/tranga.git
synced 2025-06-19 01:27:53 +02:00
Created Logger
This commit is contained in:
19
Logging/FileLogger.cs
Normal file
19
Logging/FileLogger.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Logging;
|
||||
|
||||
public class FileLogger : LoggerBase
|
||||
{
|
||||
private string logFilePath { get; }
|
||||
|
||||
public FileLogger(string logFilePath, TextWriter? stdOut, Encoding? encoding = null) : base (stdOut, encoding)
|
||||
{
|
||||
this.logFilePath = logFilePath;
|
||||
}
|
||||
|
||||
protected override void Write(LogMessage logMessage)
|
||||
{
|
||||
File.AppendAllText(logFilePath, logMessage.ToString());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user