@@ -17,20 +17,32 @@ public static class LOG
17
17
/// 追蹤記錄檔
18
18
/// </summary>
19
19
/// <param name="Message"></param>
20
+ /// <param name="WriteTxt"></param>
20
21
/// <param name="arg"></param>
21
- public static void Trace_Log ( string Message , string [ ] arg )
22
+ public static void Trace_Log ( string Message , bool WriteTxt , string [ ] arg )
22
23
{
23
24
Message = $ "{ DateTime . Now . ToString ( "HH:mm:ss" ) } [{ Thread . CurrentThread . ManagedThreadId } ] { Message } ";
24
25
Console . WriteLine ( Message , arg ) ;
25
- LogText . Add_LogText ( "Trace" , Message , arg ) ;
26
+ if ( WriteTxt )
27
+ LogText . Add_LogText ( "Trace" , Message , arg ) ;
26
28
}
27
29
/// <summary>
28
30
/// 追蹤記錄檔
29
31
/// </summary>
30
32
/// <param name="Message"></param>
31
33
public static void Trace_Log ( string Message )
32
34
{
33
- Trace_Log ( Message , new string [ 0 ] ) ;
35
+ Trace_Log ( Message , true , new string [ 0 ] ) ;
36
+ }
37
+
38
+ /// <summary>
39
+ /// 追蹤記錄檔
40
+ /// </summary>
41
+ /// <param name="Message"></param>
42
+ /// <param name="WriteTxt"></param>
43
+ public static void Trace_Log ( string Message , bool WriteTxt )
44
+ {
45
+ Trace_Log ( Message , WriteTxt , new string [ 0 ] ) ;
34
46
}
35
47
36
48
#endregion
@@ -42,11 +54,12 @@ public static void Trace_Log(string Message)
42
54
/// </summary>
43
55
/// <param name="Message">訊息</param>
44
56
/// <param name="arg">正規化文字</param>
45
- public static void Debug_Log ( string Message , string [ ] arg )
57
+ public static void Debug_Log ( string Message , bool WriteTxt , string [ ] arg )
46
58
{
47
59
Message = $ "{ DateTime . Now . ToString ( "HH:mm:ss" ) } [{ Thread . CurrentThread . ManagedThreadId } ] { Message } ";
48
60
Console . WriteLine ( Message , arg ) ;
49
- LogText . Add_LogText ( "Debug" , Message , arg ) ;
61
+ if ( WriteTxt )
62
+ LogText . Add_LogText ( "Debug" , Message , arg ) ;
50
63
}
51
64
52
65
/// <summary>
@@ -55,7 +68,15 @@ public static void Debug_Log(string Message, string[] arg)
55
68
/// <param name="Message">訊息</param>
56
69
public static void Debug_Log ( string Message )
57
70
{
58
- Debug_Log ( Message , new string [ 0 ] ) ;
71
+ Debug_Log ( Message , true , new string [ 0 ] ) ;
72
+ }
73
+ /// <summary>
74
+ /// 測試記錄檔
75
+ /// </summary>
76
+ /// <param name="Message">訊息</param>
77
+ public static void Debug_Log ( string Message , bool WriteTxt )
78
+ {
79
+ Debug_Log ( Message , WriteTxt , new string [ 0 ] ) ;
59
80
}
60
81
61
82
#endregion
@@ -68,11 +89,12 @@ public static void Debug_Log(string Message)
68
89
/// </summary>
69
90
/// <param name="Message">訊息</param>
70
91
/// <param name="arg">正規化文字</param>
71
- public static void Info_Log ( string Message , string [ ] arg )
92
+ public static void Info_Log ( string Message , bool WriteTxt , string [ ] arg )
72
93
{
73
94
Message = $ "{ DateTime . Now . ToString ( "HH:mm:ss" ) } [{ Thread . CurrentThread . ManagedThreadId } ] { Message } ";
74
95
Console . WriteLine ( Message , arg ) ;
75
- LogText . Add_LogText ( "Info" , Message , arg ) ;
96
+ if ( WriteTxt )
97
+ LogText . Add_LogText ( "Info" , Message , arg ) ;
76
98
}
77
99
78
100
/// <summary>
@@ -81,7 +103,16 @@ public static void Info_Log(string Message, string[] arg)
81
103
/// <param name="Message">訊息</param>
82
104
public static void Info_Log ( string Message )
83
105
{
84
- Info_Log ( Message , new string [ 0 ] ) ;
106
+ Info_Log ( Message , true , new string [ 0 ] ) ;
107
+ }
108
+
109
+ /// <summary>
110
+ /// 訊息記錄檔
111
+ /// </summary>
112
+ /// <param name="Message">訊息</param>
113
+ public static void Info_Log ( string Message , bool WriteTxt )
114
+ {
115
+ Info_Log ( Message , WriteTxt , new string [ 0 ] ) ;
85
116
}
86
117
87
118
@@ -94,11 +125,12 @@ public static void Info_Log(string Message)
94
125
/// </summary>
95
126
/// <param name="Message">訊息</param>
96
127
/// <param name="arg">正規化文字</param>
97
- public static void Warn_Log ( string Message , string [ ] arg )
128
+ public static void Warn_Log ( string Message , bool WriteTxt , string [ ] arg )
98
129
{
99
130
Message = $ "{ DateTime . Now . ToString ( "HH:mm:ss" ) } [{ Thread . CurrentThread . ManagedThreadId } ] { Message } ";
100
131
Console . WriteLine ( Message , arg ) ;
101
- LogText . Add_LogText ( "Warn" , Message , arg ) ;
132
+ if ( WriteTxt )
133
+ LogText . Add_LogText ( "Warn" , Message , arg ) ;
102
134
}
103
135
104
136
/// <summary>
@@ -107,7 +139,16 @@ public static void Warn_Log(string Message, string[] arg)
107
139
/// <param name="Message">訊息</param>
108
140
public static void Warn_Log ( string Message )
109
141
{
110
- Warn_Log ( Message , new string [ 0 ] ) ;
142
+ Warn_Log ( Message , true , new string [ 0 ] ) ;
143
+ }
144
+
145
+ /// <summary>
146
+ /// 警告記錄檔
147
+ /// </summary>
148
+ /// <param name="Message">訊息</param>
149
+ public static void Warn_Log ( string Message , bool WriteTxt )
150
+ {
151
+ Warn_Log ( Message , WriteTxt , new string [ 0 ] ) ;
111
152
}
112
153
113
154
/// <summary>
@@ -179,11 +220,12 @@ private static void GetExceptionMessage(Exception ex, ref String Message)
179
220
/// </summary>
180
221
/// <param name="Message">訊息</param>
181
222
/// <param name="arg">正規化文字</param>
182
- public static void Error_Log ( string Message , string [ ] arg )
223
+ public static void Error_Log ( string Message , bool WriteTxt , string [ ] arg )
183
224
{
184
225
Message = $ "{ DateTime . Now . ToString ( "HH:mm:ss" ) } [{ Thread . CurrentThread . ManagedThreadId } ] { Message } ";
185
226
Console . WriteLine ( Message , arg ) ;
186
- LogText . Add_LogText ( "Error" , Message , arg ) ;
227
+ if ( WriteTxt )
228
+ LogText . Add_LogText ( "Error" , Message , arg ) ;
187
229
}
188
230
189
231
/// <summary>
@@ -192,7 +234,16 @@ public static void Error_Log(string Message, string[] arg)
192
234
/// <param name="Message">訊息</param>
193
235
public static void Error_Log ( string Message )
194
236
{
195
- Error_Log ( Message , new string [ 0 ] ) ;
237
+ Error_Log ( Message , true , new string [ 0 ] ) ;
238
+ }
239
+
240
+ /// <summary>
241
+ /// 錯誤紀錄檔
242
+ /// </summary>
243
+ /// <param name="Message">訊息</param>
244
+ public static void Error_Log ( string Message , bool WriteTxt )
245
+ {
246
+ Error_Log ( Message , WriteTxt , new string [ 0 ] ) ;
196
247
}
197
248
198
249
#endregion
@@ -228,11 +279,12 @@ public static void Fatal_Log(string Message)
228
279
/// <param name="Custom">自定義名稱</param>
229
280
/// <param name="Message">訊息</param>
230
281
/// <param name="arg">正規化文字</param>
231
- public static void CostomName_Log ( string Custom , string Message , string [ ] arg )
282
+ public static void CostomName_Log ( string Custom , string Message , bool WriteTxt , string [ ] arg )
232
283
{
233
284
Message = $ "{ DateTime . Now . ToString ( "HH:mm:ss" ) } [{ Thread . CurrentThread . ManagedThreadId } ] { Message } ";
234
285
Console . WriteLine ( Message , arg ) ;
235
- LogText . Add_LogText ( Custom , Message , arg ) ;
286
+ if ( WriteTxt )
287
+ LogText . Add_LogText ( Custom , Message , arg ) ;
236
288
}
237
289
238
290
/// <summary>
@@ -242,7 +294,17 @@ public static void CostomName_Log(string Custom, string Message, string[] arg)
242
294
/// <param name="Message">訊息</param>
243
295
public static void CostomName_Log ( string Custom , string Message )
244
296
{
245
- CostomName_Log ( Custom , Message , new string [ 0 ] ) ;
297
+ CostomName_Log ( Custom , Message , true , new string [ 0 ] ) ;
298
+ }
299
+
300
+ /// <summary>
301
+ /// 自定義名稱Log記錄檔
302
+ /// </summary>
303
+ /// <param name="Custom">自定義名稱</param>
304
+ /// <param name="Message">訊息</param>
305
+ public static void CostomName_Log ( string Custom , string Message , bool WriteTxt )
306
+ {
307
+ CostomName_Log ( Custom , Message , WriteTxt , new string [ 0 ] ) ;
246
308
}
247
309
248
310
/// <summary>
0 commit comments