Improve logging for PT Run (#6800)

* init code pass

* adjusting tabbing for readabilty

* few small adjustments
This commit is contained in:
Clint Rutkas
2020-09-23 16:32:06 -07:00
committed by GitHub
parent dafc1e0c7d
commit b071220b6c
35 changed files with 186 additions and 289 deletions

View File

@@ -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);
}
}
}