using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Winsoft.GOV.XF.WebApi.WXCore.Helpers { public static class Utilities { static ILoggerFactory _loggerFactory; public static void ConfigureLogger(ILoggerFactory loggerFactory) { _loggerFactory = loggerFactory; } public static ILogger CreateLogger() { if (_loggerFactory == null) { throw new InvalidOperationException($"{nameof(ILogger)} is not configured. {nameof(ConfigureLogger)} must be called before use"); //_loggerFactory = new LoggerFactory().AddConsole().AddDebug(); } return _loggerFactory.CreateLogger(); } public static string ContentRootPath { get; set; } } }