namespace LogHelper
{
    /// <summary>
    /// 信息日志
    /// </summary>
    public class InfoLog : ILogType
    {
        /// <summary>
        /// 日志名称
        /// </summary>
        public string LogName => "Info";

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

        /// <summary>
        /// 日志子项集合
        /// </summary>
        public Dictionary<string, string> SubLogNames { get; set; }

        static InfoLog()
        {
            Log ??= new InfoLog();
        }

        public InfoLog()
        {
            SubLogNames = new Dictionary<string, string>
            {
                ["INFO"] = "Info"
            };
            LogHub.Init(this);
        }

        /// <summary>
        /// 系统执行信息
        /// </summary>
        /// <param name="msg"></param>
        public static void INFO_INIT(string msg)
        {
            Log.Info(msg, "INFO_INIT");
        }

        /// <summary>
        /// 系统执行信息
        /// </summary>
        /// <param name="msg"></param>
        public static void INFO_SRMALARM(string msg)
        {
            Log.Info(msg, "INFO_SRMALARM");
        }

        /// <summary>
        /// 系统执行信息  基本检查条件不满足时记录
        /// </summary>
        /// <param name="msg"></param>
        public static void INFO_INFO(string msg)
        {
            Log.Info(msg, "INFO_INFO");
        }

        /// <summary>
        /// 系统执行错误
        /// </summary>
        /// <param name="msg"></param>
        public static void INFO_ERROR(string msg)
        {
            Log.Error(msg, "INFO_ERROR");
            //Console.WriteLine(msg);
        }

        /// <summary>
        /// 系统执行警告 所有一直错误都归类为警告
        /// </summary>
        /// <param name="msg"></param>
        public static void INFO_WARN(string msg)
        {
            Log.Warn(msg, "INFO_WARN");
            //Console.WriteLine(msg);
        }

        /// <summary>
        /// 系统执行警告 所有一直错误都归类为警告,存入数据库
        /// </summary>
        /// <param name="msg">错误内容</param>
        /// <param name="code">设备</param>
        public static void INFO_WarnDb(string msg, string code)
        {
            Log.Warn(msg, "INFO_WARN");
            //WCS.Service.Helpers.LogHelper.AddWCS_EXCEPTION(msg, code, type.ToString());
            //WMS.TaskException(code, msg);
        }

        /// <summary>
        /// 堆垛机写入记录
        /// </summary>
        /// <param name="msg"></param>
        public static void INFO_SRMINFO(string msg)
        {
            Log.Info(msg, "INFO_SRMINFO");
        }

        /// <summary>
        /// 任务状态更新记录
        /// </summary>
        /// <param name="msg"></param>
        public static void INFO_SYTASKSTATUS(string msg)
        {
            Log.Info(msg, "INFO_SYTASKSTATUS");
        }

        /// <summary>
        /// WMS请求记录
        /// </summary>
        /// <param name="msg"></param>
        public static void INFO_WMSREQUEST(string msg)
        {
            Log.Info(msg, "INFO_WMSREQUEST");
        }

        /// <summary>
        /// PLC读取记录
        /// </summary>
        /// <param name="msg"></param>
        public static void INFO_PLCREADLOG(string msg)
        {
            Log.Info(msg, "INFO_PLCREADLOG");
        }

        /// <summary>
        /// 计时器
        /// </summary>
        /// <param name="msg"></param>
        public static void INFO_TIMING(string msg)
        {
            Log.Info(msg, "INFO_TIMING");
        }

        /// <summary>
        /// WCS异常上抛记录
        /// </summary>
        /// <param name="msg"></param>
        public static void INFO_I_WCS_GetExcTask(string msg)
        {
            Log.Info(msg, "INFO_UPEX");
        }

        /// <summary>
        /// 任务创建记录
        /// </summary>
        /// <param name="msg"></param>
        public static void INFO_CREATETASKIN(string msg)
        {
            Log.Info(msg, "INFO_CREATETASKIN");
        }

        /// <summary>
        /// RGV的写入记录
        /// </summary>
        /// <param name="msg"></param>
        public static void INFO_RGVINFO(string msg)
        {
            Log.Info(msg, "INFO_RGVINFO");
        }

        /// <summary>
        /// AGV相关日志
        /// </summary>
        /// <param name="msg"></param>
        public static void INFO_AGV(string msg)
        {
            Log.Info(msg, "INFO_AGV");
        }
    }
}
