Skip to content

Commit

Permalink
[PT Run] Add logs for Launcher (#8489)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykhailopylyp committed Dec 10, 2020
1 parent 1790bfe commit 6cefb4e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/launcher/Microsoft.Launcher/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,11 @@ class Microsoft_Launcher : public PowertoyModuleIface
{
if (WaitForSingleObject(m_hProcess, 0) == WAIT_OBJECT_0)
{
// The process exited, restart it
Logger::warn("PowerToys Run has exited unexpectedly, restarting PowerToys Run.");
enable();
}

Logger::trace("Set POWER_LAUNCHER_SHARED_EVENT");
SetEvent(m_hEvent);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
// See the LICENSE file in the project root for more information.

using System;
using System.Reflection;
using System.Threading;
using System.Windows;
using Wox.Plugin.Logger;

namespace PowerLauncher.Helper
{
Expand All @@ -19,6 +21,7 @@ public static void WaitForEventLoop(string eventName, Action callback)
{
if (eventHandle.WaitOne())
{
Log.Info("Successfully waited for POWER_LAUNCHER_SHARED_EVENT", MethodBase.GetCurrentMethod().DeclaringType);
Application.Current.Dispatcher.Invoke(callback);
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/modules/launcher/PowerLauncher/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
Expand All @@ -23,6 +24,7 @@
using Wox.Infrastructure.Storage;
using Wox.Infrastructure.UserSettings;
using Wox.Plugin;
using Wox.Plugin.Logger;

namespace PowerLauncher.ViewModel
{
Expand Down Expand Up @@ -742,6 +744,7 @@ private void OnHotkey()
{
Application.Current.Dispatcher.Invoke(() =>
{
Log.Info("OnHotkey", MethodBase.GetCurrentMethod().DeclaringType);
if (!ShouldIgnoreHotkeys())
{
// If launcher window was hidden and the hotkey was pressed, start telemetry event
Expand Down

0 comments on commit 6cefb4e

Please sign in to comment.