write error log to Event

This commit is contained in:
Paddy Xu
2017-12-28 22:46:15 +02:00
parent c78fbb009a
commit 311d723bb3
+6
View File
@@ -148,6 +148,12 @@ namespace QuickLook
Debug.WriteLine(e.SourceException.ToString());
Debug.WriteLine(e.SourceException.StackTrace);
const string source = "QuickLook Preview Error";
if (!EventLog.SourceExists(source))
EventLog.CreateEventSource(source, "Application");
EventLog.WriteEntry(source, e.SourceException.ToString(),
EventLogEntryType.Error);
if (plugin != PluginManager.GetInstance().DefaultPlugin.GetType())
BeginShowNewWindow(path, PluginManager.GetInstance().DefaultPlugin);
else