首页 > 代码库 > 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)); } }}
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。