using LogHelper;

namespace DBHelper
{
    public class DbLog : ILogType
    {
        /// <summary>
        /// 日志名称
        /// </summary>
        public string LogName => "Db";

        /// <summary>
        /// 日志
        /// </summary>
        public static ILogType Log { get; set; }

        public Dictionary<string, string> SubLogNames { get; set; }

        static DbLog()
        {
            Log = new DbLog();
        }

        public DbLog()
        {
            SubLogNames = new Dictionary<string, string>
            {
                ["DB"] = "Db"
            };
            LogHub.Init(this);
        }

        /// <summary>
        /// 用于记录DB执行内容
        /// </summary>
        /// <param name="msg"></param>
        public static void DBEX(string msg)
        {
            Log.Info(msg, "DB_EX");
        }

        /// <summary>
        /// 用于记录DB清理记录
        /// </summary>
        /// <param name="msg"></param>
        public static void DB_CLEAN(string msg)
        {
            Log.Info(msg, "DB_CLEAN");
        }

        public static void INFO_PLCREADLOG(string msg)
        {
            Log.Info(msg, "INFO_PLCREADLOG");
        }
    }
}
