mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add public methods
This commit is contained in:
parent
2589fac0bc
commit
e753bb79b1
2 changed files with 39 additions and 0 deletions
|
|
@ -473,5 +473,31 @@ namespace Flow.Launcher.Plugin
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Task UninstallPluginAsync(PluginMetadata pluginMetadata, bool removePluginSettings = false);
|
public Task UninstallPluginAsync(PluginMetadata pluginMetadata, bool removePluginSettings = false);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Log debug message of the time taken to execute a method
|
||||||
|
/// Message will only be logged in Debug mode
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The time taken to execute the method in milliseconds</returns>
|
||||||
|
public long StopWatchLogDebug(string className, string message, Action action, [CallerMemberName] string methodName = "");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Log debug message of the time taken to execute a method asynchronously
|
||||||
|
/// Message will only be logged in Debug mode
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The time taken to execute the method in milliseconds</returns>
|
||||||
|
public Task<long> StopWatchLogDebugAsync(string className, string message, Func<Task> action, [CallerMemberName] string methodName = "");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Log info message of the time taken to execute a method
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The time taken to execute the method in milliseconds</returns>
|
||||||
|
public long StopWatchLogInfo(string className, string message, Action action, [CallerMemberName] string methodName = "");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Log info message of the time taken to execute a method asynchronously
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The time taken to execute the method in milliseconds</returns>
|
||||||
|
public Task<long> StopWatchLogInfoAsync(string className, string message, Func<Task> action, [CallerMemberName] string methodName = "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ using Flow.Launcher.Plugin.SharedCommands;
|
||||||
using Flow.Launcher.ViewModel;
|
using Flow.Launcher.ViewModel;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Squirrel;
|
using Squirrel;
|
||||||
|
using Stopwatch = Flow.Launcher.Infrastructure.Stopwatch;
|
||||||
|
|
||||||
namespace Flow.Launcher
|
namespace Flow.Launcher
|
||||||
{
|
{
|
||||||
|
|
@ -431,6 +432,18 @@ namespace Flow.Launcher
|
||||||
public Task UninstallPluginAsync(PluginMetadata pluginMetadata, bool removePluginSettings = false) =>
|
public Task UninstallPluginAsync(PluginMetadata pluginMetadata, bool removePluginSettings = false) =>
|
||||||
PluginManager.UninstallPluginAsync(pluginMetadata, removePluginSettings);
|
PluginManager.UninstallPluginAsync(pluginMetadata, removePluginSettings);
|
||||||
|
|
||||||
|
public long StopWatchLogDebug(string className, string message, Action action, [CallerMemberName] string methodName = "") =>
|
||||||
|
Stopwatch.Debug($"|{className}.{methodName}|{message}", action);
|
||||||
|
|
||||||
|
public Task<long> StopWatchLogDebugAsync(string className, string message, Func<Task> action, [CallerMemberName] string methodName = "") =>
|
||||||
|
Stopwatch.DebugAsync($"|{className}.{methodName}|{message}", action);
|
||||||
|
|
||||||
|
public long StopWatchLogInfo(string className, string message, Action action, [CallerMemberName] string methodName = "") =>
|
||||||
|
Stopwatch.Normal($"|{className}.{methodName}|{message}", action);
|
||||||
|
|
||||||
|
public Task<long> StopWatchLogInfoAsync(string className, string message, Func<Task> action, [CallerMemberName] string methodName = "") =>
|
||||||
|
Stopwatch.NormalAsync($"|{className}.{methodName}|{message}", action);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue