Skip to content

Commit ff168e1

Browse files
lampenlampenFelixZacher
lampenlampen
andauthored
Add logging to QuickLook (#988)
Co-authored-by: Felix Zacher <[email protected]>
1 parent 1749252 commit ff168e1

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

Files.Launcher/Program.cs

+2
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ private static async void Connection_RequestReceived(AppServiceConnection sender
156156
var arguments = (string)args.Request.Message["Arguments"];
157157
var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
158158

159+
Logger.Info($"Argument: {arguments}");
160+
159161
if (arguments == "Terminate")
160162
{
161163
// Exit fulltrust process (UWP is closed or suspended)

Files.Launcher/QuickLook.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@
33
using System.IO.Pipes;
44
using System.Security.Principal;
55
using Windows.Storage;
6+
using NLog;
67

78
namespace FilesFullTrust
89
{
910
internal static class QuickLook
1011
{
12+
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
13+
1114
public static void ToggleQuickLook(string path)
1215
{
16+
Logger.Info("Toggle QuickLook");
17+
1318
string PipeName = "QuickLook.App.Pipe." + WindowsIdentity.GetCurrent().User?.Value;
1419
string Toggle = "QuickLook.App.PipeMessages.Toggle";
1520

@@ -53,7 +58,10 @@ static int QuickLookServerAvailable()
5358
}
5459
}
5560

56-
localSettings.Values["quicklook_enabled"] = QuickLookServerAvailable() != 0;
61+
var result = QuickLookServerAvailable();
62+
63+
Logger.Info($"QuickLook detected: {result != 0}");
64+
localSettings.Values["quicklook_enabled"] = result != 0;
5765
}
5866
}
5967
}

Files/Interacts/Interaction.cs

+4
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,15 @@
3535
using Windows.UI.Xaml.Input;
3636
using Windows.UI.Xaml.Media;
3737
using Windows.UI.Xaml.Media.Animation;
38+
using NLog;
3839
using static Files.Dialogs.ConfirmDeleteDialog;
3940

4041
namespace Files.Interacts
4142
{
4243
public class Interaction
4344
{
45+
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
46+
4447
private readonly IShellPage CurrentInstance;
4548
private readonly InstanceTabsView instanceTabsView;
4649

@@ -1166,6 +1169,7 @@ public async void ToggleQuickLook()
11661169
{
11671170
var clickedOnItem = CurrentInstance.ContentPage.SelectedItem;
11681171

1172+
Logger.Info("Toggle QuickLook");
11691173
Debug.WriteLine("Toggle QuickLook");
11701174
if (App.Connection != null)
11711175
{

0 commit comments

Comments
 (0)