You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
988 B
C#
56 lines
988 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.IO;
|
|
using NLog;
|
|
|
|
namespace CommonFunc
|
|
{
|
|
public class Logger : IDisposable
|
|
{
|
|
|
|
NLog.Logger logger = LogManager.GetLogger("loggerFile");
|
|
|
|
public Logger()
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 信息记录
|
|
/// </summary>
|
|
/// <param name="msg"></param>
|
|
public void Log(string msg)
|
|
{
|
|
logger.Info(msg);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 错误记录
|
|
/// </summary>
|
|
/// <param name="msg"></param>
|
|
public void Error(string msg)
|
|
{
|
|
|
|
logger.Error(msg);
|
|
}
|
|
|
|
public void Close()
|
|
{
|
|
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
Dispose(true);
|
|
GC.SuppressFinalize(true);
|
|
}
|
|
|
|
protected virtual void Dispose(bool disposing)
|
|
{
|
|
if (!disposing)
|
|
return;
|
|
}
|
|
}
|
|
}
|