diff --git a/src/Avalonia.Base/AvaloniaObject.cs b/src/Avalonia.Base/AvaloniaObject.cs index ddcf16e11a..8d9a98d087 100644 --- a/src/Avalonia.Base/AvaloniaObject.cs +++ b/src/Avalonia.Base/AvaloniaObject.cs @@ -820,16 +820,13 @@ namespace Avalonia /// The priority. private void LogPropertySet(AvaloniaProperty property, object value, BindingPriority priority) { - if (Logger.TryGetLogger(LogEventLevel.Verbose, out var logger)) - { - logger.Log( - LogArea.Property, - this, - "Set {Property} to {$Value} with priority {Priority}", - property, - value, - priority); - } + Logger.TryGetLogger(LogEventLevel.Verbose)?.Log( + LogArea.Property, + this, + "Set {Property} to {$Value} with priority {Priority}", + property, + value, + priority); } private class DirectBindingSubscription : IObserver, IDisposable