mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 20:27:36 +02:00
Better logger
1. Throw exception for fatal/error log when debugging 2. Write to debug output for warn/debug/info log when debugging 3. part of #355
This commit is contained in:
@@ -18,14 +18,6 @@ namespace Wox.Infrastructure
|
||||
#endif
|
||||
}
|
||||
|
||||
[Conditional("DEBUG")]
|
||||
private static void WriteTimeInfo(string name, long milliseconds)
|
||||
{
|
||||
string info = $"{name} : {milliseconds}ms";
|
||||
System.Diagnostics.Debug.WriteLine(info);
|
||||
Log.Info(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This stopwatch will also appear only in Debug mode
|
||||
/// </summary>
|
||||
@@ -36,7 +28,8 @@ namespace Wox.Infrastructure
|
||||
action();
|
||||
stopWatch.Stop();
|
||||
var milliseconds = stopWatch.ElapsedMilliseconds;
|
||||
WriteTimeInfo(name, milliseconds);
|
||||
string info = $"{name} : {milliseconds}ms";
|
||||
Log.Debug(info);
|
||||
return milliseconds;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user