From b0c18d369abd06075c83759b0e19823c2a11d716 Mon Sep 17 00:00:00 2001 From: ulysseskao <ulysseskao@gmail.com> Date: Fri, 29 Apr 2016 18:45:41 +0800 Subject: [PATCH] update for new model --- CCSTrace/CCS/RecordLog.cs | 29 +++++++++++------------------ 1 files changed, 11 insertions(+), 18 deletions(-) diff --git a/CCSTrace/CCS/RecordLog.cs b/CCSTrace/CCS/RecordLog.cs index e528624..9925cd7 100644 --- a/CCSTrace/CCS/RecordLog.cs +++ b/CCSTrace/CCS/RecordLog.cs @@ -1,52 +1,45 @@ using System; -using System.Data; -using System.Configuration; -using System.Web; -using System.Web.Security; -using System.Web.UI; -using System.Web.UI.HtmlControls; -using System.Web.UI.WebControls; -using System.Web.UI.WebControls.WebParts; +using System.IO; namespace CCSTrace.CCS { public class RecordLog { - private System.IO.StreamWriter _SWriter = null; + private readonly StreamWriter _sWriter = null; - public RecordLog(String FilePath) + public RecordLog(string filePath) { - _SWriter = new System.IO.StreamWriter(FilePath,true); + _sWriter = new StreamWriter(filePath, true); } public void Debug(object message) { - _SWriter.WriteLine("[Debug] [" + System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + "] : " + message); + _sWriter.WriteLine("[Debug] [" + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + "] : " + message); } public void Error(object message) { - _SWriter.WriteLine("[Error] [" + System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + "] : " + message); + _sWriter.WriteLine("[Error] [" + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + "] : " + message); } public void Fatal(object message) { - _SWriter.WriteLine("[Fatal] [" + System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + "] : " + message); + _sWriter.WriteLine("[Fatal] [" + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + "] : " + message); } public void Info(object message) { - _SWriter.WriteLine("[Info] [" + System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + "] : " + message); + _sWriter.WriteLine("[Info] [" + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + "] : " + message); } public void Warn(object message) { - _SWriter.WriteLine("[Warn] [" + System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + "] : " + message); + _sWriter.WriteLine("[Warn] [" + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + "] : " + message); } public void Close() { - _SWriter.Close(); + _sWriter.Close(); } } -} +} \ No newline at end of file -- Gitblit v0.0.0-SNAPSHOT