using CFX;
using CFX.ResourcePerformance;
using CFX.Structures;
using Sln.Iot.Serilog;

namespace Sln.Iot.CFX.Event
{
    /// <summary>
    /// 日志记录事件
    /// </summary>
    public class LogEntryRecordedEvent
    {
        /// <summary>
        /// 数据封装处理
        /// </summary>
        /// <returns></returns>
        public CFXMessage Handle()
        {
            CFXMessage eve = null;
            try
            {
                eve = new LogEntryRecorded()
                {
                    InformationId = "I1234567890",
                    Message = "logContent",
                    Importance = LogImportance.Information,
                    Lane = 1,
                    Stage = new Stage()
                    {
                        StageSequence = 1,
                        StageName = "工段1",
                        StageType = StageType.Work
                    }
                };
            }
            catch (Exception e)
            {
                SerilogHelper.Instance.Error("终端节点连接事件数据封装异常", e);
            }
            return eve;
        }
    }
}
