VLog.cs
727 字节
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DeviceLibrary
{
public class VLog
{
ILog log;
string Prefix="";
public VLog(string prefix="",string logname= "VStore") {
Prefix = prefix;
log = LogManager.GetLogger(logname);
}
public void Info(string txt) {
if (Prefix != "")
txt =$"[{Prefix}] "+ txt;
log.Info(txt);
}
public void Error(string txt)
{
if (Prefix != "")
txt = $"[{Prefix}] " + txt;
log.Error(txt);
}
}
}