我有一个使用 Prism 的 xamarin.forms 应用程序。但是我需要向它添加几个 microsoft.extensions.logging ILoggers。在用于日志记录的标准 microsoft.extensions.dependencyinjection 设置中,我通常会这样做
serviceCollection.AddLogging(builder =>
{
builder.AddDebug();
builder.AddConsole();
builder.AddApplicationInsights(someKey);
});
我将如何使用 Prism 做到这一点?我还能获得打字的 ILogger 吗?例如
public ThingieService(ILogger<ThingieService> logger)