More updates to event infrastructure

This commit is contained in:
Ske
2020-08-27 18:20:20 +02:00
parent e27826955e
commit 8d27148bdf
6 changed files with 186 additions and 75 deletions

View File

@@ -82,10 +82,12 @@ namespace PluralKit.Core
public class LoggingModule: Module
{
private readonly string _component;
private readonly Action<LoggerConfiguration> _fn;
public LoggingModule(string component)
public LoggingModule(string component, Action<LoggerConfiguration> fn = null)
{
_component = component;
_fn = fn ?? (_ => { });
}
protected override void Load(ContainerBuilder builder)
@@ -143,6 +145,7 @@ namespace PluralKit.Core
c => c.Elasticsearch(elasticConfig));
}
_fn.Invoke(logger);
return logger.CreateLogger();
}
}