开发框架旗舰版:数据库日志DBLog类实现ILogUserOperate接口设计
开发框架旗舰版:数据库日志DBLog类实现ILogUserOperate接口设计
扫一扫加作者微信
DBLog类:
C# Code:
/// <summary>
/// 数据库日志
/// </summary>
public class DBLog : ILogUserOperate
{
#region 数据日志单例
static DBLog _Instance = null;
public static DBLog Log
{
get
{
if (_Instance == null) _Instance = new DBLog();
return _Instance;
}
}
#endregion;
//
//省略代码...
//
}
//来源:C/S框架网 | www.csframework.com | QQ:23404761
/// 数据库日志
/// </summary>
public class DBLog : ILogUserOperate
{
#region 数据日志单例
static DBLog _Instance = null;
public static DBLog Log
{
get
{
if (_Instance == null) _Instance = new DBLog();
return _Instance;
}
}
#endregion;
//
//省略代码...
//
}
//来源:C/S框架网 | www.csframework.com | QQ:23404761
数据库日志查询界面:
DBLog类使用方法:
C# Code:
DBLog.Log.WriteLog("未指定类型的普通日志");
DBLog.Log.WriteLog(LogTypeSystem.Normal, "普通日志");
DBLog.Log.WriteLog(LogTypeSystem.CustomError, "用户自定义异常");
DBLog.Log.WriteLog(LogTypeSystem.Exception, "系统异常");
DBLog.Log.WriteLog(LogTypeSystem.OpenForm, "打开功能界面日志");
//来源:C/S框架网 | www.csframework.com | QQ:23404761
DBLog.Log.WriteLog(LogTypeSystem.Normal, "普通日志");
DBLog.Log.WriteLog(LogTypeSystem.CustomError, "用户自定义异常");
DBLog.Log.WriteLog(LogTypeSystem.Exception, "系统异常");
DBLog.Log.WriteLog(LogTypeSystem.OpenForm, "打开功能界面日志");
//来源:C/S框架网 | www.csframework.com | QQ:23404761
日志类型:
C# Code:
/// <summary>
/// 系统操作日志类型
/// </summary>
public enum LogTypeSystem
{
/// <summary>
/// 普通日志
/// </summary>
Normal = 0,
/// <summary>
/// 打开窗体日志
/// </summary>
OpenForm = 1,
/// <summary>
/// 系统异常日志
/// </summary>
Exception = 2,
/// <summary>
/// 用户自定义错误日志
/// </summary>
CustomError = 3
}
//来源:C/S框架网 | www.csframework.com | QQ:23404761
/// <summary>
/// 系统操作日志类型
/// </summary>
public enum LogTypeSystem
{
/// <summary>
/// 普通日志
/// </summary>
Normal = 0,
/// <summary>
/// 打开窗体日志
/// </summary>
OpenForm = 1,
/// <summary>
/// 系统异常日志
/// </summary>
Exception = 2,
/// <summary>
/// 用户自定义错误日志
/// </summary>
CustomError = 3
}
//来源:C/S框架网 | www.csframework.com | QQ:23404761
扫一扫加作者微信
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网