瀏覽代碼

配置NLog,可以格式化输出线程id,指定对齐宽度

tanghai 14 年之前
父節點
當前提交
f84f4752bb
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      CSharp/Editor/NLog.config
  2. 1 1
      CSharp/Editor/ViewModel/MainViewModel.cs

+ 1 - 1
CSharp/Editor/NLog.config

@@ -3,7 +3,7 @@
 		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 	<targets>
 		<target name="file" xsi:type="File" fileName="${basedir}/Log.txt"
-				layout="${date:format=HH\:mm\:ss}|${threadid}|${level}|${message}"/>
+				layout="${date:format=HH\:mm\:ss}|${threadid:padCharacter=0:padding=4:fixedLength=true}|${message}"/>
 	</targets>
 	<rules>
 		<logger name="*" minlevel="Trace" writeTo="file"/>

+ 1 - 1
CSharp/Editor/ViewModel/MainViewModel.cs

@@ -4,6 +4,7 @@ using System.Windows.Threading;
 using GalaSoft.MvvmLight;
 using GalaSoft.MvvmLight.Command;
 using GalaSoft.MvvmLight.Threading;
+using System.Threading;
 
 namespace Egametang
 {
@@ -45,7 +46,6 @@ namespace Egametang
 		{
 			var task = new Task(() =>
 			{
-				App.Logger.Debug("11111");
 			});
 			task.ContinueWith(_ =>
 			{