Exemplo n.º 1
0
 /// <summary>
 /// 致命的消息
 /// </summary>
 /// <param name="message">消息</param>
 /// <param name="data">自定义数据</param>
 /// <param name="tags">标签</param>
 public void Fatal(string message, ExcDataParam data, params string[] tags)
 {
     Submit(message, LogLevel.Fatal, data, tags);
 }
Exemplo n.º 2
0
 /// <summary>
 /// 信息
 /// </summary>
 /// <param name="message">消息</param>
 /// <param name="data">自定义数据</param>
 /// <param name="tags">标签</param>
 public void Info(string message, ExcDataParam data, params string[] tags)
 {
     Submit(message, LogLevel.Info, data, tags);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 调试信息
 /// </summary>
 /// <param name="message">消息</param>
 /// <param name="user">用户信息</param>
 /// <param name="data">自定义数据</param>
 /// <param name="tags">标签</param>
 public void Debug(string message, ExcUserParam user, ExcDataParam data, params string[] tags)
 {
     Submit(message, LogLevel.Debug, user, data, tags);
 }
Exemplo n.º 4
0
 /// <summary>
 /// 警告消息
 /// </summary>
 /// <param name="message">消息</param>
 /// <param name="user">用户信息</param>
 /// <param name="data">自定义数据</param>
 /// <param name="tags">标签</param>
 public void Warn(string message, ExcUserParam user, ExcDataParam data, params string[] tags)
 {
     Submit(message, LogLevel.Fatal, user, data, tags);
 }
Exemplo n.º 5
0
 /// <summary>
 /// 异常消息
 /// </summary>
 /// <param name="message">消息</param>
 /// <param name="user">用户信息</param>
 /// <param name="data">自定义数据</param>
 /// <param name="tags">标签</param>
 public void Error(string message, ExcUserParam user, ExcDataParam data, params string[] tags)
 {
     Submit(message, LogLevel.Error, user, data, tags);
 }
Exemplo n.º 6
0
 /// <summary>
 /// 跟踪信息
 /// </summary>
 /// <param name="message">消息</param>
 /// <param name="user">用户信息</param>
 /// <param name="data">自定义数据</param>
 /// <param name="tags">标签</param>
 public void Trace(string message, ExcUserParam user, ExcDataParam data, params string[] tags)
 {
     Submit(message, LogLevel.Trace, user, data, tags);
 }
Exemplo n.º 7
0
        /// <summary>
        /// 消息日志测试
        /// </summary>
        public static void MessageTest()
        {
            string tagName = "消息标签";//自定义标签
            var    data    = new ExcDataParam()
            {
                Name = "请求参数", Data = new { Id = 001, Name = "张三" }
            };                                                                                    //自定义单个model
            var user = new ExcUserParam()
            {
                Id = "No0001", Name = "李廷礼", Email = "*****@*****.**", Description = "菁鲤汇高级开发工程师"
            };                                    //用户信息
            var datas = new List <ExcDataParam>() //自定义列表数据
            {
                new ExcDataParam()
                {
                    Name = "请求参数",
                    Data = new { Id = 002, Name = "李四" }
                },
                new ExcDataParam()
                {
                    Name = "返回结果",
                    Data = new { Id = 003, Name = "王五" }
                }
            };

            //日志等级:跟踪信息
            LogMessagesLess.Trace("不带参数");
            LogMessagesLess.Trace("带标签", tagName);
            LogMessagesLess.Trace("带用户&标签", user, tagName);
            LogMessagesLess.Trace("带自定义数据&标签", data, tagName);
            LogMessagesLess.Trace("带自定义数据&标签", datas, tagName);
            LogMessagesLess.Trace("带用户&自定义数据&标签", user, data, tagName);
            LogMessagesLess.Trace("带用户&自定义数据&标签", user, datas, tagName);

            //日志等级:调试信息
            LogMessagesLess.Debug("不带参数");
            LogMessagesLess.Debug("带标签", tagName);
            LogMessagesLess.Debug("带用户&标签", user, tagName);
            LogMessagesLess.Debug("带自定义数据&标签", data, tagName);
            LogMessagesLess.Debug("带自定义数据&标签", datas, tagName);
            LogMessagesLess.Debug("带用户&自定义数据&标签", user, data, tagName);
            LogMessagesLess.Debug("带用户&自定义数据&标签", user, datas, tagName);

            //日志等级:普通信息
            LogMessagesLess.Info("不带参数");
            LogMessagesLess.Info("带标签", tagName);
            LogMessagesLess.Info("带用户&标签", user, tagName);
            LogMessagesLess.Info("带自定义数据&标签", data, tagName);
            LogMessagesLess.Info("带自定义数据&标签", datas, tagName);
            LogMessagesLess.Info("带用户&自定义数据&标签", user, data, tagName);
            LogMessagesLess.Info("带用户&自定义数据&标签", user, datas, tagName);

            //日志等级:警告
            LogMessagesLess.Warn("不带参数");
            LogMessagesLess.Warn("带标签", tagName);
            LogMessagesLess.Warn("带用户&标签", user, tagName);
            LogMessagesLess.Warn("带自定义数据&标签", data, tagName);
            LogMessagesLess.Warn("带自定义数据&标签", datas, tagName);
            LogMessagesLess.Warn("带用户&自定义数据&标签", user, data, tagName);
            LogMessagesLess.Warn("带用户&自定义数据&标签", user, datas, tagName);

            //日志等级:致命的
            LogMessagesLess.Fatal("不带参数");
            LogMessagesLess.Fatal("带标签", tagName);
            LogMessagesLess.Fatal("带用户&标签", user, tagName);
            LogMessagesLess.Fatal("带自定义数据&标签", data, tagName);
            LogMessagesLess.Fatal("带自定义数据&标签", datas, tagName);
            LogMessagesLess.Fatal("带用户&自定义数据&标签", user, data, tagName);
            LogMessagesLess.Fatal("带用户&自定义数据&标签", user, datas, tagName);

            //日志等级:异常
            LogMessagesLess.Error("不带参数");
            LogMessagesLess.Error("带标签", tagName);
            LogMessagesLess.Error("带用户&标签", user, tagName);
            LogMessagesLess.Error("带自定义数据&标签", data, tagName);
            LogMessagesLess.Error("带自定义数据&标签", datas, tagName);
            LogMessagesLess.Error("带用户&自定义数据&标签", user, data, tagName);
            LogMessagesLess.Error("带用户&自定义数据&标签", user, datas, tagName);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 提交异常
        /// </summary>
        /// <param name="ex"></param>
        /// <param name="user">用户信息</param>
        /// <param name="data"></param>
        /// <param name="tags"></param>
        public static void Submit(this Exception ex, ExcUserParam user, ExcDataParam data, params string[] tags)
        {
            var datas = new List <ExcDataParam>();

            ex.Submit(user, datas, tags);
        }
Exemplo n.º 9
0
 /// <summary>
 /// 提交异常
 /// </summary>
 /// <param name="ex"></param>
 /// <param name="data"></param>
 /// <param name="level"></param>
 /// <param name="tags"></param>
 public static void Submit(this Exception ex, ExcDataParam data, params string[] tags)
 {
     ex.Submit(null, data, tags);
 }
Exemplo n.º 10
0
 /// <summary>
 /// 信息
 /// </summary>
 /// <param name="message">消息</param>
 /// <param name="user">用户信息</param>
 /// <param name="data">自定义数据</param>
 /// <param name="tags">标签</param>
 public static void Info(string message, ExcUserParam user, ExcDataParam data, params string[] tags)
 {
     Submit(message, LogLevel.Info, user, data, tags);
 }
Exemplo n.º 11
0
 /// <summary>
 /// 提交异常
 /// </summary>
 /// <param name="message">特性信息</param>
 /// <param name="data">自定义数据</param>
 /// <param name="tags">标签</param>
 public static void Submit(string message, ExcDataParam data, params string[] tags)
 {
     Submit(message, null, data, tags);
 }