zoukankan      html  css  js  c++  java
  • LogData

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using WindowsFormsApplication3.Model;
    using WindowsFormsApplication3.Enums;
    
    namespace WindowsFormsApplication3.DataStorge
    {
        public class LogData
        {
            public List<LogEntry> logList;
    
            public LogData()
            {
                logList = new List<LogEntry>();
            }
            
    
            public void Error(string format, params object[] objects) { 
                Error(string.Format(format,objects));
            }
            public void Error(CheckoutStep checkoutStep, string message)
            {
                message = string.Format("ERROR {0}", message);
                WriteLine(checkoutStep, message, true);
            }
    
            public void Start(string format, params object[] objects)
            {
                Start(string.Format(format, objects));
            }
            public void Start(CheckoutStep checkoutStep, string message)
            {
                message = string.Format("START {0}", message);
                WriteLine(checkoutStep, message, true);
            }
    
            public void Info(CheckoutStep checkoutStep, string message) {
                message = string.Format("INFO {0}", message);
                WriteLine(checkoutStep, message, false);
            }
            public void Info(string format, params object[] objects) {
                Info(string.Format(format, objects));
            }
    
            public void Warn(CheckoutStep checkoutStep, string message)
            {
                message = string.Format("WARN {0}", message);
                WriteLine(checkoutStep, message, false);
            }
            public void Warn(string format, params object[] objects)
            {
                Info(string.Format(format, objects));
            }
    
            public void Finish(string format, params object[] objects)
            {
                Finish(string.Format(format, objects));
            }
            public void Finish(CheckoutStep checkoutStep, string message)
            {
                message = string.Format("FINISH {0}", message);
                WriteLine(checkoutStep, message, true);
            }
    
            public void WriteLine(CheckoutStep checkoutStep,string message,bool isError)
            {
                logList.Add(new LogEntry(checkoutStep, message, isError));
            }
        }
    }
  • 相关阅读:
    阿里高级技术专家谈开源DDD框架:COLA4.0,分离架构和组件
    react的setState到底是同步还是异步?
    JMeter入门教程
    手把手教你接口自动化测试 – SoapUI & Groovy
    解读Web应用程序安全性问题的本质
    python实现的json数据以HTTP GET,POST,PUT,DELETE方式页面请求
    Linux常用命令
    PV原语操作详解
    软考计算机网络原理之IP计算问题汇总
    化繁为简了解进程与线程
  • 原文地址:https://www.cnblogs.com/rosizel/p/3861614.html
Copyright © 2011-2022 走看看