コード例 #1
0
 /// <summary>
 /// 创建事件生成器
 /// </summary>
 /// <param name="level">平台日志等级</param>
 /// <param name="content">日志内容</param>
 /// <returns></returns>
 private el.EventBuilder CreateBuilder(LogLevel level, ILogContent content)
 {
     if (content.Exception != null)
     {
         return(_client.CreateException(content.Exception).AddTags(level.Description()));
     }
     return(_client.CreateLog(GetMessage(content), ConvertTo(level)));
 }
コード例 #2
0
 /// <summary>
 /// 创建事件生成器
 /// </summary>
 /// <param name="level">平台日志等级</param>
 /// <param name="content">日志内容</param>
 private el.EventBuilder CreateBuilder(LogLevel level, ILogContent content)
 {
     if (content.Exception != null && (level == LogLevel.Error || level == LogLevel.Fatal))
         return _client.CreateException(content.Exception);
     var builder = _client.CreateLog(GetMessage(content), ConvertTo(level));
     if (content.Exception != null && level == LogLevel.Warning)
         builder.SetException(content.Exception);
     return builder;
 }
コード例 #3
0
        /// <summary>
        /// 创建事件生成器
        /// </summary>
        /// <param name="level">平台日志等级</param>
        /// <param name="content">日志内容</param>
        private el.EventBuilder CreateBuilder(LogLevel level, ILogContent content)
        {
            if (content.Exception != null && (level == LogLevel.Error || level == LogLevel.Fatal))
            {
                return(_client.CreateException(content.Exception));
            }
            var builder = _client.CreateLog(GetMessage(content), LogLevelSwitcher.Switch(level));

            if (content.Exception != null && level == LogLevel.Warning)
            {
                builder.SetException(content.Exception);
            }
            return(builder);
        }