From 89dc9e7e7f3c27fd409f8800df381bcce2b103e4 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Mon, 2 Nov 2015 13:43:09 +0000 Subject: [PATCH] Better log info --- Wox.Infrastructure/NLog.config | 2 +- Wox.Infrastructure/Timeit.cs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Wox.Infrastructure/NLog.config b/Wox.Infrastructure/NLog.config index 9dcf31def0..896abfdf6c 100644 --- a/Wox.Infrastructure/NLog.config +++ b/Wox.Infrastructure/NLog.config @@ -18,6 +18,6 @@ - + \ No newline at end of file diff --git a/Wox.Infrastructure/Timeit.cs b/Wox.Infrastructure/Timeit.cs index 6b6e0d704d..8bad568501 100644 --- a/Wox.Infrastructure/Timeit.cs +++ b/Wox.Infrastructure/Timeit.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using Wox.Infrastructure.Logger; using Wox.Plugin; namespace Wox.Infrastructure @@ -23,7 +24,9 @@ namespace Wox.Infrastructure _stopwatch.Stop(); long seconds = _stopwatch.ElapsedMilliseconds; _stopwatch.Start(); - Debug.WriteLine(_name + " : " + _stopwatch.ElapsedMilliseconds + "ms"); + string info = _name + " : " + _stopwatch.ElapsedMilliseconds + "ms"; + Debug.WriteLine(info); + Log.Info(info); return seconds; } } @@ -32,7 +35,9 @@ namespace Wox.Infrastructure public void Dispose() { _stopwatch.Stop(); - Debug.WriteLine(_name + ":" + _stopwatch.ElapsedMilliseconds + "ms"); + string info = _name + " : " + _stopwatch.ElapsedMilliseconds + "ms"; + Debug.WriteLine(info); + Log.Info(info); } } }