namespace Log;

public interface ILog : IDisposable
{
    public string? Directory { get; }
    public string? FilePath { get; }
    bool Initialize(string fileName);
    bool Debug(string message, DateTime? dateTime = null);
    bool Info(string message, DateTime? dateTime = null);
    bool Warning(string message, DateTime? dateTime = null);
    bool Error(string message, DateTime? dateTime = null);
    bool Fatal(string message, DateTime? dateTime = null);
}


public class LogInfo(LogLevel logLevel, string message, DateTime? logTime = null)
{
    public DateTime Time
    {
        get
        {
            logTime ??= DateTime.Now;
            return logTime.Value;
        }
    }
    public LogLevel Level { get; } = logLevel;
    public string Message { get; set; } = message;
}

public enum LogLevel
{
    Undefined = 0,
    Info = 1,
    Warning = 2,
    Error = 3,
    Fatal = 4,
    Debug = 5,
}