/// <summary> /// LogTrace /// </summary> /// <param name="logger"></param> /// <param name="eventId"></param> /// <param name="message"></param> /// <param name="args"></param> public static void LogTrace(this ILiteXLogger logger, int eventId, string message, params object[] args) { if (logger == null) { throw new ArgumentNullException("logger"); } logger.Log(LiteXLogLevel.Trace, eventId, new FormatMessage(message, args), null); }
/// <summary> /// LogCritical /// </summary> /// <param name="logger"></param> /// <param name="exception"></param> /// <param name="message"></param> /// <param name="args"></param> public static void LogCritical(this ILiteXLogger logger, Exception exception, string message, params object[] args) { if (logger == null) { throw new ArgumentNullException("logger"); } logger.Log(LiteXLogLevel.Critical, 0, new FormatMessage(message, args), exception); }
/// <summary> /// LogWarn /// </summary> /// <param name="logger"></param> /// <param name="message"></param> /// <param name="args"></param> public static void LogWarn(this ILiteXLogger logger, string message, params object[] args) { if (logger == null) { throw new ArgumentNullException("logger"); } logger.Log(LiteXLogLevel.Warning, 0, new FormatMessage(message, args), null); }
/// <summary> /// Ctor /// Initializes a new instance of the <see cref="T:LiteX.Cache.SQLite.SQLiteCachingProvider" /> class. /// </summary> /// <param name="perRequestCacheManager">per request cacheManager</param> /// <param name="connectionWrapper">Connection wrapper</param> /// <param name="config">Config options</param> /// <param name="loggerFactory">Logger Factory</param> public SQLiteCacheManager(ICacheManager perRequestCacheManager, ISQLiteConnectionProvider connectionWrapper, SQLiteConfig config, ILiteXLoggerFactory loggerFactory = null) { if (string.IsNullOrEmpty(config.FileName)) { throw new Exception("FileName is empty"); } if (string.IsNullOrEmpty(config.FilePath)) { throw new Exception("FilePath is empty"); } _config = config; _perRequestCacheManager = perRequestCacheManager; _connectionWrapper = connectionWrapper; _connection = _connectionWrapper.GetConnection(); _logger = (loggerFactory?.CreateLogger(this) ?? new LiteXNullLoggerFactory().CreateLogger(this)); }
/// <summary> /// Gets a key/value collection that can be used to share data within the scope of this request /// </summary> /// <param name="httpContextAccessor">httpContextAccessor</param> /// <param name="loggerFactory">Logger Factory</param> public PerRequestCacheManager(IHttpContextAccessor httpContextAccessor, ILiteXLoggerFactory loggerFactory = null) { _httpContextAccessor = httpContextAccessor; _logger = (loggerFactory?.CreateLogger(this) ?? new LiteXNullLoggerFactory().CreateLogger(this)); }