示例#1
0
 /// <summary>
 /// 执行
 /// </summary>
 /// <param name="level">日志级别</param>
 /// <param name="content">日志内容</param>
 protected virtual void Execute(LogLevel level, ref TContent content)
 {
     if (content == null)
         return;
     if (Enabled(level) == false)
         return;
     try
     {
         content.Level = Enum.GetName<LogLevel>(level);
         Init(content);
         Provider.WriteLog(level, content);
     }
     finally
     {
         content = null;
     }
 }
示例#2
0
 public void Test_GetName_Nullable(object member, string name)
 {
     Assert.Equal(name, Enum.GetName <EnumSample?>(member));
 }
示例#3
0
 public void Test_GetName_Validate()
 {
     Assert.Equal(string.Empty, Enum.GetName(typeof(Sample), 3));
 }