namespace DotBased.Logging;

/// <summary>
/// Main logger, this class is the default logger that the <see cref="LogService.RegisterLogger"/> function will return.
/// </summary>
public class Logger(LoggerInformation loggerInformation, string name) : LoggerBase(loggerInformation, name)
{
    public override void Verbose(string message, params object?[]? parameters)
    {
        Log(new LogCapsule(this, LogSeverity.Verbose, message, null, parameters, DateTime.Now));
    }
    
    public override void Trace(string message, params object?[]? parameters)
    {
        Log(new LogCapsule(this, LogSeverity.Trace, message, null, parameters, DateTime.Now));
    }

    public override void Debug(string message, params object?[]? parameters)
    {
        Log(new LogCapsule(this, LogSeverity.Debug, message, null, parameters, DateTime.Now));
    }

    public override void Information(string message, params object?[]? parameters)
    {
        Log(new LogCapsule(this, LogSeverity.Info, message, null, parameters, DateTime.Now));
    }

    public override void Warning(string message, params object?[]? parameters)
    {
        Log(new LogCapsule(this, LogSeverity.Warning, message, null, parameters, DateTime.Now));
    }

    public override void Error(Exception exception, string message, params object?[]? parameters)
    {
        Log(new LogCapsule(this, LogSeverity.Error, message, null, parameters, DateTime.Now));
    }

    public override void Fatal(Exception exception, string message, params object?[]? parameters)
    {
        Log(new LogCapsule(this, LogSeverity.Fatal, message, null, parameters, DateTime.Now));
    }

    public override int GetHashCode() => HashCode.Combine(LoggerInformation.TypeFullName, LoggerInformation.AssemblyFullname);
}