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/SEventLog.cs | 29 ++++++++++++++---------------
1 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/CCSTrace/CCS/SEventLog.cs b/CCSTrace/CCS/SEventLog.cs
index 98cf30c..a4f260f 100644
--- a/CCSTrace/CCS/SEventLog.cs
+++ b/CCSTrace/CCS/SEventLog.cs
@@ -1,12 +1,11 @@
-using System;
-using System.Diagnostics;
+using System.Diagnostics;
namespace CCSTrace.CCS
{
- public class SEventLog
+ public class SEventLog
{
- static string sSource = "CCSTrace";
- static string sLog = "Application";
+ private const string SSource = "CCSTrace";
+ private const string SLog = "Application";
public SEventLog()
{
@@ -14,11 +13,11 @@
public void Debug(object message)
{
- if (!EventLog.SourceExists(sSource))
- EventLog.CreateEventSource(sSource, sLog);
+ if (!EventLog.SourceExists(SSource))
+ EventLog.CreateEventSource(SSource, SLog);
//EventLog.WriteEntry(sSource, message.ToString());
- EventLog.WriteEntry(sSource, message.ToString(), EventLogEntryType.Information, 001);
+ EventLog.WriteEntry(SSource, message.ToString(), EventLogEntryType.Information, 001);
}
public void Error(object message)
@@ -32,11 +31,11 @@
public void Fatal(object message)
{
- if (!EventLog.SourceExists(sSource))
- EventLog.CreateEventSource(sSource, sLog);
+ if (!EventLog.SourceExists(SSource))
+ EventLog.CreateEventSource(SSource, SLog);
//EventLog.WriteEntry(sSource, message.ToString());
- EventLog.WriteEntry(sSource, message.ToString(), EventLogEntryType.FailureAudit, 001);
+ EventLog.WriteEntry(SSource, message.ToString(), EventLogEntryType.FailureAudit, 001);
}
public void Info(object message)
@@ -50,15 +49,15 @@
public void Warn(object message)
{
- if (!EventLog.SourceExists(sSource))
- EventLog.CreateEventSource(sSource, sLog);
+ if (!EventLog.SourceExists(SSource))
+ EventLog.CreateEventSource(SSource, SLog);
//EventLog.WriteEntry(sSource, message.ToString());
- EventLog.WriteEntry(sSource, message.ToString(), EventLogEntryType.Warning, 001);
+ EventLog.WriteEntry(SSource, message.ToString(), EventLogEntryType.Warning, 001);
}
public void Close()
{
}
}
-}
+}
\ No newline at end of file
--
Gitblit v0.0.0-SNAPSHOT