Rewrite all log message format

This commit is contained in:
bao-qian
2017-01-24 00:24:20 +00:00
parent fdfd684e7a
commit 045fd20d8c
25 changed files with 180 additions and 186 deletions

View File

@@ -11,29 +11,27 @@ namespace Wox.Infrastructure
/// <summary>
/// This stopwatch will appear only in Debug mode
/// </summary>
public static long Debug(string name, Action action)
public static long Debug(string message, Action action)
{
var stopWatch = new System.Diagnostics.Stopwatch();
stopWatch.Start();
action();
stopWatch.Stop();
var milliseconds = stopWatch.ElapsedMilliseconds;
string info = $"{name} : {milliseconds}ms";
var type = Log.CallerType();
Log.Debug(type, info);
string info = $"{message} <{milliseconds}ms>";
Log.Debug(info);
return milliseconds;
}
public static long Normal(string name, Action action)
public static long Normal(string message, Action action)
{
var stopWatch = new System.Diagnostics.Stopwatch();
stopWatch.Start();
action();
stopWatch.Stop();
var milliseconds = stopWatch.ElapsedMilliseconds;
string info = $"{name} : {milliseconds}ms";
var type = Log.CallerType();
Log.Info(type, info);
string info = $"{message} <{milliseconds}ms>";
Log.Info(info);
return milliseconds;
}