diff --git a/Flow.Launcher.Avalonia/MainWindow.axaml.cs b/Flow.Launcher.Avalonia/MainWindow.axaml.cs index b2c0700d9..47372a4e9 100644 --- a/Flow.Launcher.Avalonia/MainWindow.axaml.cs +++ b/Flow.Launcher.Avalonia/MainWindow.axaml.cs @@ -19,9 +19,8 @@ public partial class MainWindow : Window { InitializeComponent(); - // Create and set the ViewModel - var settings = Ioc.Default.GetRequiredService(); - _viewModel = new MainViewModel(settings); + // Get the ViewModel from DI (same instance that App uses) + _viewModel = Ioc.Default.GetRequiredService(); _viewModel.HideRequested += () => Hide(); DataContext = _viewModel; diff --git a/Flow.Launcher.Infrastructure/Logger/Log.cs b/Flow.Launcher.Infrastructure/Logger/Log.cs index 09eb98f46..2fdba2dfe 100644 --- a/Flow.Launcher.Infrastructure/Logger/Log.cs +++ b/Flow.Launcher.Infrastructure/Logger/Log.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; using System.IO; using System.Runtime.CompilerServices; using System.Runtime.ExceptionServices; @@ -149,6 +149,9 @@ namespace Flow.Launcher.Infrastructure.Logger var logger = LogManager.GetLogger(classNameWithMethod); logger.Log(level, message); + + // Also output to console for easy debugging + System.Console.WriteLine($"[{level}] {classNameWithMethod}: {message}"); } public static void Debug(string className, string message, [CallerMemberName] string methodName = "")