mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-07 14:27:54 +00:00
More updates to event infrastructure
This commit is contained in:
parent
e27826955e
commit
8d27148bdf
6 changed files with 186 additions and 75 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue