首页 > 代码库 > LogData

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));        }    }}