Skip to content

Commit 86bcf2c

Browse files
committed
style: 调整日志扩展 region
1 parent 76cd0d8 commit 86bcf2c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

framework/src/Bing.Logging/Bing/Logging/ILogExtensions.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
/// </summary>
66
public static class ILogExtensions
77
{
8+
#region Append(添加消息)
9+
810
/// <summary>
911
/// 添加消息
1012
/// </summary>
@@ -70,6 +72,11 @@ public static ILog AppendLineIf(this ILog log, string message, bool condition, p
7072
return log;
7173
}
7274

75+
76+
#endregion
77+
78+
#region Line(消息换行)
79+
7380
/// <summary>
7481
/// 消息换行
7582
/// </summary>
@@ -82,6 +89,10 @@ public static ILog Line(this ILog log)
8289
return log;
8390
}
8491

92+
#endregion
93+
94+
#region ExtraProperty(设置扩展属性)
95+
8596
/// <summary>
8697
/// 设置扩展属性
8798
/// </summary>
@@ -101,6 +112,10 @@ public static ILog ExtraProperty(this ILog log, string propertyName, object prop
101112
public static ILog ExtraPropertyIf(this ILog log, string propertyName, object propertyValue, bool condition) =>
102113
!condition ? log : log.Set(x => x.Context.SetExtraProperty(propertyName, propertyValue));
103114

115+
#endregion
116+
117+
#region Tags(设置标签)
118+
104119
/// <summary>
105120
/// 设置标签列表
106121
/// </summary>
@@ -132,4 +147,7 @@ public static ILog TagsIf(this ILog log, bool condition, params string[] tags) =
132147
/// <param name="condition">条件,值为true时,则添加标签</param>
133148
public static ILog TagIf(this ILog log, string tag, bool condition) =>
134149
!condition ? log : log.Set(x => x.Context.SetTags(tag));
150+
151+
#endregion
152+
135153
}

0 commit comments

Comments
 (0)