mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[PowerToys Run] Logging (#11378)
This commit is contained in:
@@ -243,7 +243,7 @@ public:
|
||||
|
||||
if (run_non_elevated(action_runner_path, params, pidBuffer))
|
||||
{
|
||||
Logger::trace("Started PowerToys Run Process. PID {}", *pidBuffer);
|
||||
Logger::trace("Started PowerToys Run Process");
|
||||
m_enabled = true;
|
||||
const int maxRetries = 80;
|
||||
for (int retry = 0; retry < maxRetries; ++retry)
|
||||
|
||||
@@ -42,6 +42,7 @@ namespace PowerLauncher
|
||||
[STAThread]
|
||||
public static void Main()
|
||||
{
|
||||
Log.Info($"Starting PowerToys Run with PID={Process.GetCurrentProcess().Id}", typeof(App));
|
||||
if (SingleInstance<App>.InitializeAsFirstInstance(Unique))
|
||||
{
|
||||
using (var application = new App())
|
||||
@@ -50,10 +51,15 @@ namespace PowerLauncher
|
||||
application.Run();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Info("There is already running PowerToys Run instance", typeof(App));
|
||||
}
|
||||
}
|
||||
|
||||
private void OnStartup(object sender, StartupEventArgs e)
|
||||
{
|
||||
Log.Info("On Startup.", GetType());
|
||||
for (int i = 0; i + 1 < e.Args.Length; i++)
|
||||
{
|
||||
if (e.Args[i] == "-powerToysPid")
|
||||
@@ -61,8 +67,10 @@ namespace PowerLauncher
|
||||
int powerToysPid;
|
||||
if (int.TryParse(e.Args[i + 1], out powerToysPid))
|
||||
{
|
||||
Log.Info($"Runner pid={powerToysPid}", GetType());
|
||||
RunnerHelper.WaitForPowerToysRunner(powerToysPid, () =>
|
||||
{
|
||||
Log.Info($"Runner with pid={powerToysPid} exited. Exiting PowerToys Run", GetType());
|
||||
try
|
||||
{
|
||||
Dispose();
|
||||
|
||||
@@ -91,6 +91,7 @@
|
||||
<ItemGroup>
|
||||
<None Include="Resources.resx" />
|
||||
</ItemGroup>
|
||||
<Import Project="..\..\..\..\deps\spdlog.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
|
||||
Reference in New Issue
Block a user