using Microsoft.Extensions.Logging;

namespace Femto.Common.Logs;

public static partial class LoggerExtensions
{
    [LoggerMessage(
        LogLevel.Error,
        EventId = 1,
        EventName = "FailedRequestWithException",
        Message = "Request failed: {Method} {Path}, Status: {StatusCode}, TraceId: {TraceId}, Message: {Message}"
    )]
    public static partial void LogFailedRequest(
        this ILogger logger,
        Exception exception,
        string method,
        string path,
        int statusCode,
        string traceId,
        string message
    );
    
    [LoggerMessage(
        LogLevel.Error,
        EventId = 2,
        EventName = "FailedRequest",
        Message = "Request failed: {Method} {Path}, Status: {StatusCode}, TraceId: {TraceId}, Message: {Message}"
    )]
    public static partial void LogFailedRequest(
        this ILogger logger,
        string method,
        string path,
        int statusCode,
        string traceId,
        string message
    );
}
