예제 #1
0
 public ThreadedCheckScheduler(
     ICheckLog checkLog,
     ICheckStats checkStats,
     ICheckerFactory checkerFactory,
     ILog log)
 {
     _log            = log ?? throw new ArgumentNullException(nameof(log));
     _checkLog       = checkLog ?? throw new ArgumentNullException(nameof(checkLog));
     _checkStats     = checkStats ?? throw new ArgumentNullException(nameof(checkStats));
     _checkerFactory = checkerFactory ?? throw new ArgumentNullException(nameof(checkerFactory));
 }
예제 #2
0
        /// <summary>
        /// 检测结果日志
        /// </summary>
        /// <param name="checkLog"></param>
        /// <param name="level"></param>
        /// <param name="msg"></param>
        /// <param name="result"></param>
        /// <param name="equipment"></param>
        public static void CheckMsgLog(ICheckLog <ILogger> checkLog, LogLevel level, string msg, string result, string equipment, DateTime receiveTime)
        {
            LogEventInfo theEvent = NLogMgr.GetEventInfo(level, "", NLogMgr.LoggerName.Check);

            NLogMgr.SetEventProperties(theEvent,
                                       new SetEventPropertieParam(NLogMgr.EventProperties.CheckTarget, equipment),
                                       new SetEventPropertieParam(NLogMgr.EventProperties.CheckMsg, msg),
                                       new SetEventPropertieParam(NLogMgr.EventProperties.CheckResult, result),
                                       new SetEventPropertieParam(NLogMgr.EventProperties.CheckReceive, receiveTime.ToString("yyyy-MM-dd HH:mm:ss.ffff")));

            checkLog.GetLogger().Log(theEvent);
        }