namespace Universal.IO;

public class RawDataLog : BaseFilter
{
    private class LogData(bool IsSend, Data rawData)
    {
        public bool IsSend { get; } = IsSend;

        public Data RawData { get; } = rawData;
    }

    private EventQueue<LogData>? _logEvent;
    private string? _filePath;

    public bool Initialize(string filePath)
    {
        _filePath = filePath;
        _logEvent = new(LogEvent);
        return true;
    }

    public override bool Receive(Data data)
    {
        _logEvent?.Enqueue(new(false, data));
        return base.Receive(data);
    }

    public override bool Send(Data data)
    {
        _logEvent?.Enqueue(new(true, data));
        return base.Send(data);
    }


    private void LogEvent(LogData data)
    {
        //Write Log Here
    }
}