首页 > 其他 > 详细

LogData

时间:2014-07-23 11:47:46      阅读:219      评论:0      收藏:0      [点我收藏+]
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));
        }
    }
}

LogData,布布扣,bubuko.com

LogData

原文:http://www.cnblogs.com/rosizel/p/3861614.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!