From cc5ea17ff247a291e29742135f5bed9ce1707f9c Mon Sep 17 00:00:00 2001 From: Yaser Moradi Date: Thu, 14 Nov 2024 19:22:01 +0100 Subject: [PATCH] fix --- .../Extensions/ILoggingBuilderExtensions.cs | 5 +---- .../Client/Boilerplate.Client.Windows/Program.Services.cs | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/ILoggingBuilderExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/ILoggingBuilderExtensions.cs index 474e6d82fa..45064824a0 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/ILoggingBuilderExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Extensions/ILoggingBuilderExtensions.cs @@ -13,8 +13,6 @@ public static ILoggingBuilder AddDiagnosticLogger(this ILoggingBuilder builder) public static ILoggingBuilder ConfigureLoggers(this ILoggingBuilder loggingBuilder) { - loggingBuilder.ClearProviders(); - if (AppEnvironment.IsDev()) { loggingBuilder.AddDebug(); @@ -22,9 +20,8 @@ public static ILoggingBuilder ConfigureLoggers(this ILoggingBuilder loggingBuild if (!AppPlatform.IsBrowser) { + // Browser has its own BrowserConsoleLogger. loggingBuilder.AddConsole(); - // DiagnosticLogger is already logging in browser's console. - // But Console logger is still useful in Visual Studio's Device Log (Android, iOS) or BrowserStack etc. } loggingBuilder.AddDiagnosticLogger(); diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Program.Services.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Program.Services.cs index 0a9b133850..445b900fa5 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Program.Services.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Program.Services.cs @@ -42,10 +42,7 @@ public static void AddClientWindowsProjectServices(this IServiceCollection servi loggingBuilder.AddConfiguration(configuration.GetSection("Logging")); loggingBuilder.AddEventSourceLogger(); - if (AppPlatform.IsWindows) - { - loggingBuilder.AddEventLog(); - } + loggingBuilder.AddEventLog(); //#if (appCenter == true) if (Microsoft.AppCenter.AppCenter.Configured) {