Exemplo n.º 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;
     }
 }
Exemplo n.º 2
0
 public void Test_GetName_Nullable(object member, string name)
 {
     Assert.Equal(name, Enum.GetName <EnumSample?>(member));
 }
Exemplo n.º 3
0
 public void Test_GetName_Validate()
 {
     Assert.Equal(string.Empty, Enum.GetName(typeof(Sample), 3));
 }