Skip to content

Commit

Permalink
renamed vars
Browse files Browse the repository at this point in the history
  • Loading branch information
lsfera committed Jul 5, 2024
1 parent 2055fed commit eadba73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Blumchen.DependencyInjection/Workers/Worker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public abstract class Worker<T>(
{
private readonly ILogger<Worker<T>> _logger = loggerFactory.CreateLogger<Worker<T>>();
private string WorkerName { get; } = $"{nameof(Worker<T>)}<{typeof(T).Name}>";
private static readonly ConcurrentDictionary<string, Action<ILogger, string, object[]>> _actions = new(StringComparer.OrdinalIgnoreCase);
private static readonly ConcurrentDictionary<string, Action<ILogger, string, object[]>> LoggingActions = new(StringComparer.OrdinalIgnoreCase);
private static void Notify(ILogger logger, LogLevel level, string template, params object[] parameters)
{
static Action<ILogger, string, object[]> LoggerAction(LogLevel ll, bool enabled) =>
Expand All @@ -35,7 +35,7 @@ static Action<ILogger, string, object[]> LoggerAction(LogLevel ll, bool enabled)
(LogLevel.Debug, true) => (logger, template, parameters) => logger.LogDebug(template, parameters),
(_, _) => (_, __, ___) => { }
};
_actions.GetOrAdd(template,s => LoggerAction(level, logger.IsEnabled(level)))(logger, template, parameters);
LoggingActions.GetOrAdd(template,s => LoggerAction(level, logger.IsEnabled(level)))(logger, template, parameters);
}

protected override async Task ExecuteAsync(CancellationToken stoppingToken)
Expand Down

0 comments on commit eadba73

Please sign in to comment.