using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

namespace OpenWarehouse.Common.Lib;

public static class BuildLogger
{
    public static ILogger GetBuildLogger<T>(this T builder)
        where T : IHostApplicationBuilder
    {
        using var loggerFactory = LoggerFactory.Create(loggingBuilder => loggingBuilder
            .SetMinimumLevel(LogLevel.Information)
            .AddConsole());

        ILogger logger = loggerFactory.CreateLogger<T>();
        
        
        return logger;
    }
}