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));
            }
        }
    }
  • 相关阅读:
    《编写可维护的JavaScript》读书笔记
    第十四天:还是看代码
    第十三天:过了一遍rt_thread,看代码架构
    第十二天:rt_thread系统
    第十一天:要做stm32了
    第十天:没太专注工作
    第九天:rtc问题查找与测试
    第八天:android编译环境搭建
    第七天:终于看到板子了
    第六天和周末:感慨下这周
  • 原文地址:https://www.cnblogs.com/rosizel/p/3861614.html
Copyright © 2011-2022 走看看