组件日志类优化,不再使用'['来标记分隔,使用了一个不可见字符\u0002分隔,提高筛选准确性。

This commit is contained in:
dathlin
2017-06-17 17:32:55 +08:00
parent a8aad0b3dc
commit e500d9797c
3 changed files with 2 additions and 2 deletions

Binary file not shown.

View File

@@ -129,7 +129,7 @@ namespace 软件系统客户端模版
private string FilterString(string filter)
{
StringBuilder sb = new StringBuilder();
MatchCollection mc = Regex.Matches(LogTemp, @"\[" + filter + @"[^\[]+");
MatchCollection mc = Regex.Matches(LogTemp, @"\u0002\[" + filter + @"[^\u0002]+");
foreach (Match m in mc)
{
sb.Append(m.Value);

View File

@@ -960,7 +960,7 @@ namespace 软件系统服务端模版
* 说明 日志的使用方式分为4个等级1.普通 2.信息 3.警告 4.错误 对应的调用方法不一致
* 具体 如果想要调用存储[信息]等级日志,调用 RuntimeLogHelper.SaveInformation("等待存储的信息")
* 大小 调用10000次存储信息后日志文件大小在200K左右需要手动进行情况日志
* 注意 在存储信息时不要带有'['和']'这两个字符,会影响日志筛选时的准确性
* 注意 在存储信息时不要带有一个特殊字符,[\u0002]不可见的标识文本开始字符,会影响日志筛选时的准确性
*
**********************************************************************************************************/