12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace tool
- {
- public class Log:Singleton<Log>
- {
- private Log()
- {
- }
- public void LogInit()
- {
- LogManager.Instance.LogManagerInit();
- }
- /// <summary>
- /// 写文件类型
- /// </summary>
- /// <param name="logType"></param>
- /// <param name="logFile"></param>
- /// <param name="msg"></param>
- public void WriteLog(LogType logType, LogFile logFile, string msg)
- {
- try
- {
- LogManager.Instance.WriteLog(logType, logFile, msg);
- }
- catch
- {
- }
- }
- /// <summary>
- /// 文件类型为null
- /// </summary>
- /// <param name="logType"></param>
- /// <param name="msg"></param>
- public void WriteLog(LogType logType, string msg)
- {
- try
- {
- LogManager.Instance.WriteLog(logType, string.Empty, msg);
- }
- catch
- {
- }
- }
- /// <summary>
- /// 数据库异常的标志位
- /// 0表示update,1表示insert
- /// </summary>
- /// <param name="logType"></param>
- /// <param name="status"></param>
- /// <param name="msg"></param>
- public void WriteLog(LogType logType, string status, string msg)
- {
- try
- {
- LogManager.Instance.WriteLog(logType, status, msg);
- }
- catch
- {
- }
- }
- /// <summary>
- /// 读日志文件
- /// </summary>
- /// <param name="sqlStatus"></param>
- /// <param name="sqlMsg"></param>
- /// <param name="count"></param>
- public List<string> ReadLog()
- {
- List<string> digitList = null;
- try
- {
- digitList = LogManager.Instance.ReadLog();
- }
- catch { }
- return digitList;
- }
- public void WriteCredence(string msg)
- {
- try
- {
- LogManager.Instance.WriteCredence(msg);
- }
- catch { }
- }
- }
- }
|