mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
Improve logging for PT Run (#6800)
* init code pass * adjusting tabbing for readabilty * few small adjustments
This commit is contained in:
@@ -73,7 +73,8 @@ namespace Microsoft.Plugin.Indexer
|
||||
catch (Exception e)
|
||||
{
|
||||
var message = Properties.Resources.Microsoft_plugin_indexer_clipboard_failed;
|
||||
LogException(message, e);
|
||||
Log.Exception(message, e, GetType());
|
||||
|
||||
_context.API.ShowMsg(message);
|
||||
return false;
|
||||
}
|
||||
@@ -105,7 +106,7 @@ namespace Microsoft.Plugin.Indexer
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Exception($"|Microsoft.Plugin.Indexer.ContextMenuLoader.LoadContextMenus| Failed to open {record.Path} in console, {e.Message}", e);
|
||||
Log.Exception($"Failed to open {record.Path} in console, {e.Message}", e, GetType());
|
||||
return false;
|
||||
}
|
||||
},
|
||||
@@ -136,7 +137,7 @@ namespace Microsoft.Plugin.Indexer
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Exception($"|Microsoft.Plugin.Indexer.ContextMenu| Failed to run {record.Path} as admin, {e.Message}", e);
|
||||
Log.Exception($"Failed to run {record.Path} as admin, {e.Message}", e, MethodBase.GetCurrentMethod().DeclaringType);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
@@ -178,7 +179,8 @@ namespace Microsoft.Plugin.Indexer
|
||||
catch (Exception e)
|
||||
{
|
||||
var message = $"{Properties.Resources.Microsoft_plugin_indexer_folder_open_failed} {record.Path}";
|
||||
LogException(message, e);
|
||||
Log.Exception(message, e, GetType());
|
||||
|
||||
_context.API.ShowMsg(message);
|
||||
return false;
|
||||
}
|
||||
@@ -187,10 +189,5 @@ namespace Microsoft.Plugin.Indexer
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
public static void LogException(string message, Exception e)
|
||||
{
|
||||
Log.Exception($"|Microsoft.Plugin.Folder.ContextMenu|{message}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user