diff --git a/CHANGELOG.md b/CHANGELOG.md index e87538e34..dac18e951 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Prefix your items with `(Template)` if the change is about the template and not - Updated android aot profile and profiling packages to 10.0.0-preview1. - Set MtouchUseLlvm to false for iOS release build to fix build time issue. - Changed the way that iOS app icons are added to the project. +- Updated external dependencies packages versions. ## 3.11.X - Added API Client tests project. diff --git a/Directory.Build.props b/Directory.Build.props index 32b303f9e..306a11c4f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,12 +4,12 @@ all runtime; build; native; contentfiles; analyzers - + all runtime; build; native; contentfiles; analyzers - + diff --git a/src/app/ApplicationTemplate.Access/ApplicationTemplate.Access.csproj b/src/app/ApplicationTemplate.Access/ApplicationTemplate.Access.csproj index 1328299b4..4ad2a494e 100644 --- a/src/app/ApplicationTemplate.Access/ApplicationTemplate.Access.csproj +++ b/src/app/ApplicationTemplate.Access/ApplicationTemplate.Access.csproj @@ -18,17 +18,17 @@ - - - - - + + + + + - + - + diff --git a/src/app/ApplicationTemplate.Access/PlatformServices/Email/MockedEmailService.cs b/src/app/ApplicationTemplate.Access/PlatformServices/Email/MockedEmailService.cs index 7cd05f18d..e7434a9d0 100644 --- a/src/app/ApplicationTemplate.Access/PlatformServices/Email/MockedEmailService.cs +++ b/src/app/ApplicationTemplate.Access/PlatformServices/Email/MockedEmailService.cs @@ -15,7 +15,10 @@ public MockedEmailService(ILogger logger) public Task Compose(CancellationToken ct, Email email) { - _logger.LogInformation("Email composed: {Email}", email); + if (_logger.IsEnabled(LogLevel.Information)) + { + _logger.LogInformation("Email composed: {Email}", email); + } return Task.CompletedTask; } } diff --git a/src/app/ApplicationTemplate.Business/KillSwitch/KillSwitchService.cs b/src/app/ApplicationTemplate.Business/KillSwitch/KillSwitchService.cs index c50aeab38..70f8d7f43 100644 --- a/src/app/ApplicationTemplate.Business/KillSwitch/KillSwitchService.cs +++ b/src/app/ApplicationTemplate.Business/KillSwitch/KillSwitchService.cs @@ -26,5 +26,11 @@ public KillSwitchService(IKillSwitchDataSource killSwitchDataSource, ILogger public IObservable ObserveKillSwitchActivation() => _killSwitchDataSource.ObserveKillSwitchActivation() - .Do(isActive => _logger.LogInformation("Kill switch is now {IsActive}.", isActive)); + .Do(isActive => + { + if (_logger.IsEnabled(LogLevel.Information)) + { + _logger.LogInformation("Kill switch is now {IsActive}.", isActive); + } + }); } diff --git a/src/app/ApplicationTemplate.Mobile/ApplicationTemplate.Mobile.csproj b/src/app/ApplicationTemplate.Mobile/ApplicationTemplate.Mobile.csproj index 6b66fcb54..865f6eeff 100644 --- a/src/app/ApplicationTemplate.Mobile/ApplicationTemplate.Mobile.csproj +++ b/src/app/ApplicationTemplate.Mobile/ApplicationTemplate.Mobile.csproj @@ -22,7 +22,7 @@ - + @@ -36,9 +36,9 @@ - + - + @@ -152,7 +152,7 @@ $(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep $(MtouchExtraArgs) --xml=./iOS/LinkerExclusions.xml --linkskip=$(AssemblyName) - -all,ByteSize,Uno.Core.Extensions,Uno.Core.Extensions.Collections,Uno.Core.Extensions.Equality,Uno.Core.Extensions.Threading,Uno.Core.Extensions.Disposables,Uno.Core.Extensions.Logging,Nventive.Persistence.Reactive,Reactive.Annex,ReviewService.Abstractions,MallardMessageHandlers,FluentValidation,Chinook.DataLoader.Abstractions,Chinook.DynamicMvvm.Abstractions,Chinook.SectionsNavigation.Abstractions,Chinook.StackNavigation.Abstractions,Chinook.BackButtonManager.Abstractions,ApplicationTemplate.Business,Chinook.DynamicMvvm.FluentValidation,Chinook.DataLoader.DynamicMvvm,Chinook.DataLoader,Microsoft.Maui.Controls.HotReload.Forms + -all,Microsoft.Maui.Controls.HotReload.Forms $(MtouchExtraArgs) --registrar:static diff --git a/src/app/ApplicationTemplate.Presentation/ApplicationTemplate.Presentation.csproj b/src/app/ApplicationTemplate.Presentation/ApplicationTemplate.Presentation.csproj index 2c0001085..74820dc15 100644 --- a/src/app/ApplicationTemplate.Presentation/ApplicationTemplate.Presentation.csproj +++ b/src/app/ApplicationTemplate.Presentation/ApplicationTemplate.Presentation.csproj @@ -17,12 +17,12 @@ - - - + + + - - + + diff --git a/src/app/ApplicationTemplate.Presentation/Configuration/ErrorConfiguration.cs b/src/app/ApplicationTemplate.Presentation/Configuration/ErrorConfiguration.cs index 0192c0481..dba0ba7da 100644 --- a/src/app/ApplicationTemplate.Presentation/Configuration/ErrorConfiguration.cs +++ b/src/app/ApplicationTemplate.Presentation/Configuration/ErrorConfiguration.cs @@ -41,7 +41,11 @@ public static void OnUnhandledException(Exception exception, bool isTerminating, } var logger = services.GetRequiredService>(); - logger.LogError(exception, "An unhandled exception occurred. StackTrace: {StackTrace}", exception.StackTrace); + + if (logger.IsEnabled(LogLevel.Error)) + { + logger.LogError(exception, "An unhandled exception occurred. StackTrace: {StackTrace}", exception.StackTrace); + } } private static async Task HandleCommandException(CancellationToken ct, IDynamicCommand command, Exception exception, IServiceProvider services) diff --git a/src/app/ApplicationTemplate.Presentation/CoreStartup.cs b/src/app/ApplicationTemplate.Presentation/CoreStartup.cs index 8c04e9cd0..4fb8529c0 100644 --- a/src/app/ApplicationTemplate.Presentation/CoreStartup.cs +++ b/src/app/ApplicationTemplate.Presentation/CoreStartup.cs @@ -229,7 +229,10 @@ private void SuscribeToKillSwitch(IServiceProvider serviceProvider) killSwitchService.ObserveKillSwitchActivation() .SelectManyDisposePrevious(async (activated, ct) => { - Logger.LogTrace("Kill switch activation changed to {Activated}.", activated); + if (Logger.IsEnabled(LogLevel.Trace)) + { + Logger.LogTrace("Kill switch activation changed to {Activated}.", activated); + } if (activated) { diff --git a/src/app/ApplicationTemplate.Presentation/Framework/DataLoader/LogErrorDataLoaderStrategy.cs b/src/app/ApplicationTemplate.Presentation/Framework/DataLoader/LogErrorDataLoaderStrategy.cs index 3ac4cb8bb..ca3752dd3 100644 --- a/src/app/ApplicationTemplate.Presentation/Framework/DataLoader/LogErrorDataLoaderStrategy.cs +++ b/src/app/ApplicationTemplate.Presentation/Framework/DataLoader/LogErrorDataLoaderStrategy.cs @@ -31,7 +31,10 @@ public override async Task Load(CancellationToken ct, IDataLoaderRequest } catch (Exception error) { - _logger.LogError(error, "Failed to load request '{RequestSequenceId}' in DataLoader '{DataLoaderName}'.", request.SequenceId, request.Context.GetDataLoaderName()); + if (_logger.IsEnabled(LogLevel.Error)) + { + _logger.LogError(error, "Failed to load request '{RequestSequenceId}' in DataLoader '{DataLoaderName}'.", request.SequenceId, request.Context.GetDataLoaderName()); + } throw; } diff --git a/src/app/ApplicationTemplate.Presentation/Framework/Startup/CoreStartupBase.cs b/src/app/ApplicationTemplate.Presentation/Framework/Startup/CoreStartupBase.cs index 73dbbe2e5..4b9d59dc8 100644 --- a/src/app/ApplicationTemplate.Presentation/Framework/Startup/CoreStartupBase.cs +++ b/src/app/ApplicationTemplate.Presentation/Framework/Startup/CoreStartupBase.cs @@ -150,7 +150,10 @@ public async Task Start() var isFirstStart = !State.IsStarted; - Logger.LogDebug("Starting services (isFirstStart: {IsFirstStart}).", isFirstStart); + if (Logger.IsEnabled(LogLevel.Debug)) + { + Logger.LogDebug("Starting services (isFirstStart: {IsFirstStart}).", isFirstStart); + } await StartServices(ServiceProvider, isFirstStart); diff --git a/src/app/ApplicationTemplate.Presentation/Framework/Startup/StartupBase.cs b/src/app/ApplicationTemplate.Presentation/Framework/Startup/StartupBase.cs index 32831c202..712395369 100644 --- a/src/app/ApplicationTemplate.Presentation/Framework/Startup/StartupBase.cs +++ b/src/app/ApplicationTemplate.Presentation/Framework/Startup/StartupBase.cs @@ -152,7 +152,10 @@ public async Task Start() async Task StartViewServicesWithLogs(IServiceProvider services, bool isFirstStart) { - Logger.LogDebug("Starting view services (isFirstStart: {IsFirstStart}).", isFirstStart); + if (Logger.IsEnabled(LogLevel.Debug)) + { + Logger.LogDebug("Starting view services (isFirstStart: {IsFirstStart}).", isFirstStart); + } await StartViewServices(services, isFirstStart); diff --git a/src/app/ApplicationTemplate.Presentation/Framework/Startup/WritableJsonConfigurationProvider.cs b/src/app/ApplicationTemplate.Presentation/Framework/Startup/WritableJsonConfigurationProvider.cs index 518937efe..c9ca6ac5d 100644 --- a/src/app/ApplicationTemplate.Presentation/Framework/Startup/WritableJsonConfigurationProvider.cs +++ b/src/app/ApplicationTemplate.Presentation/Framework/Startup/WritableJsonConfigurationProvider.cs @@ -50,8 +50,10 @@ public override void Set(string key, string value) } } - _logger.LogDebug("Serialized ­­­­{PairCount} key-value-pairs in {ElapsedMilliseconds}ms.", Data.Count, stopwatch.ElapsedMilliseconds); - + if (_logger.IsEnabled(LogLevel.Debug)) + { + _logger.LogDebug("Serialized ­­­­{PairCount} key-value-pairs in {ElapsedMilliseconds}ms.", Data.Count, stopwatch.ElapsedMilliseconds); + } OnReload(); } } diff --git a/src/app/ApplicationTemplate.Presentation/Framework/ViewModels/IViewModel.Extensions.Options.cs b/src/app/ApplicationTemplate.Presentation/Framework/ViewModels/IViewModel.Extensions.Options.cs index b6814ad0a..0a87f6f44 100644 --- a/src/app/ApplicationTemplate.Presentation/Framework/ViewModels/IViewModel.Extensions.Options.cs +++ b/src/app/ApplicationTemplate.Presentation/Framework/ViewModels/IViewModel.Extensions.Options.cs @@ -126,7 +126,12 @@ string GetValueAsString(TValue value) { if (value is not string && value is not bool) { - viewModel.GetService>().LogWarning("Serialization of type {TypeName} may be wrong. Consider using the valueToString parameter from the GetFromOptionsMonitor method.", typeof(TValue).Name); + var logger = viewModel.GetService(); + + if (logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("Serialization of type {TypeName} may be wrong. Consider using the valueToString parameter from the GetFromOptionsMonitor method.", typeof(TValue).Name); + } } return value.ToString(); diff --git a/src/app/ApplicationTemplate.Presentation/ViewModels/Diagnostics/LoggersDiagnosticsViewModel.cs b/src/app/ApplicationTemplate.Presentation/ViewModels/Diagnostics/LoggersDiagnosticsViewModel.cs index 760178242..b590b6cba 100644 --- a/src/app/ApplicationTemplate.Presentation/ViewModels/Diagnostics/LoggersDiagnosticsViewModel.cs +++ b/src/app/ApplicationTemplate.Presentation/ViewModels/Diagnostics/LoggersDiagnosticsViewModel.cs @@ -83,7 +83,12 @@ await this.GetService().ShowMessage(ct, mb => mb private async Task OnConsoleLoggingChanged(CancellationToken ct, bool isEnabled) { - this.GetService>().LogInformation("{IsEnabled} console logging.", isEnabled ? "Enabling" : "Disabling"); + var logger = this.GetService>(); + + if (logger.IsEnabled(LogLevel.Information)) + { + logger.LogInformation("{IsEnabled} console logging.", isEnabled ? "Enabling" : "Disabling"); + } await this.GetService().ShowMessage(ct, mb => mb .Title("Diagnostics") @@ -94,7 +99,12 @@ await this.GetService().ShowMessage(ct, mb => mb private async Task OnFileLoggingChanged(CancellationToken ct, bool isEnabled) { - this.GetService>().LogInformation("{IsEnabled} file logging.", isEnabled ? "Enabling" : "Disabling"); + var logger = this.GetService>(); + + if (logger.IsEnabled(LogLevel.Information)) + { + logger.LogInformation("{IsEnabled} file logging.", isEnabled ? "Enabling" : "Disabling"); + } await this.GetService().ShowMessage(ct, mb => mb .Title("Diagnostics") diff --git a/src/app/ApplicationTemplate.Tests.Api/ApplicationTemplate.Tests.Api.csproj b/src/app/ApplicationTemplate.Tests.Api/ApplicationTemplate.Tests.Api.csproj index dd44f7a2e..4886a1f12 100644 --- a/src/app/ApplicationTemplate.Tests.Api/ApplicationTemplate.Tests.Api.csproj +++ b/src/app/ApplicationTemplate.Tests.Api/ApplicationTemplate.Tests.Api.csproj @@ -13,7 +13,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/src/app/ApplicationTemplate.Tests.Functional/ApplicationTemplate.Tests.Functional.csproj b/src/app/ApplicationTemplate.Tests.Functional/ApplicationTemplate.Tests.Functional.csproj index deb0502cd..0e12508ae 100644 --- a/src/app/ApplicationTemplate.Tests.Functional/ApplicationTemplate.Tests.Functional.csproj +++ b/src/app/ApplicationTemplate.Tests.Functional/ApplicationTemplate.Tests.Functional.csproj @@ -11,14 +11,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/src/app/ApplicationTemplate.Tests.Unit/ApplicationTemplate.Tests.Unit.csproj b/src/app/ApplicationTemplate.Tests.Unit/ApplicationTemplate.Tests.Unit.csproj index 0d8250038..fa63e3f7f 100644 --- a/src/app/ApplicationTemplate.Tests.Unit/ApplicationTemplate.Tests.Unit.csproj +++ b/src/app/ApplicationTemplate.Tests.Unit/ApplicationTemplate.Tests.Unit.csproj @@ -10,14 +10,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/src/app/ApplicationTemplate.Tests/ApplicationTemplate.Tests.csproj b/src/app/ApplicationTemplate.Tests/ApplicationTemplate.Tests.csproj index 8d040add8..cb6af760c 100644 --- a/src/app/ApplicationTemplate.Tests/ApplicationTemplate.Tests.csproj +++ b/src/app/ApplicationTemplate.Tests/ApplicationTemplate.Tests.csproj @@ -3,7 +3,7 @@ net10.0 - + diff --git a/src/app/ApplicationTemplate.Windows/ApplicationTemplate.Windows.csproj b/src/app/ApplicationTemplate.Windows/ApplicationTemplate.Windows.csproj index b3acf60fa..b247b6a1e 100644 --- a/src/app/ApplicationTemplate.Windows/ApplicationTemplate.Windows.csproj +++ b/src/app/ApplicationTemplate.Windows/ApplicationTemplate.Windows.csproj @@ -75,18 +75,18 @@ - - - - - + + + + + - +