Ejemplo n.º 1
0
        /// <summary>
        /// Notifies that a monitor invoked an action.
        /// </summary>
        /// <param name="monitor">Monitor</param>
        /// <param name="action">Action</param>
        /// <param name="receivedEvent">Event</param>
        internal override void NotifyInvokedAction(Monitor monitor, MethodInfo action, Event receivedEvent)
        {
            if (base.Configuration.Verbose <= 1)
            {
                return;
            }

            base.Logger.OnMonitorAction(monitor.GetType().Name, monitor.Id, action.Name, monitor.CurrentStateName);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Notifies that a monitor raised an <see cref="Event"/>.
        /// </summary>
        /// <param name="monitor">Monitor</param>
        /// <param name="eventInfo">EventInfo</param>
        internal override void NotifyRaisedEvent(Monitor monitor, EventInfo eventInfo)
        {
            if (base.Configuration.Verbose <= 1)
            {
                return;
            }

            base.Logger.OnMonitorEvent(monitor.GetType().Name, monitor.Id, monitor.CurrentStateName,
                                       eventInfo.EventName, isProcessing: false);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Notifies that a monitor raised an <see cref="Event"/>.
        /// </summary>
        /// <param name="monitor">Monitor</param>
        /// <param name="eventInfo">EventInfo</param>
        internal override void NotifyRaisedEvent(Monitor monitor, EventInfo eventInfo)
        {
            if (base.Configuration.Verbose <= 1)
            {
                return;
            }

            base.Log($"<MonitorLog> Monitor '{monitor.GetType().Name}' raised " +
                     $"event '{eventInfo.EventName}'.");
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Notifies that a monitor invoked an action.
        /// </summary>
        /// <param name="monitor">Monitor</param>
        /// <param name="action">Action</param>
        /// <param name="receivedEvent">Event</param>
        internal override void NotifyInvokedAction(Monitor monitor, MethodInfo action, Event receivedEvent)
        {
            if (base.Configuration.Verbose <= 1)
            {
                return;
            }

            base.Log($"<MonitorLog> Monitor '{monitor.GetType().Name}' executed " +
                     $"action '{action.Name}' in state '{monitor.CurrentStateName}'.");
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Notifies that a monitor exited a state.
        /// </summary>
        /// <param name="monitor">Monitor</param>
        internal override void NotifyExitedState(Monitor monitor)
        {
            if (base.Configuration.Verbose <= 1)
            {
                return;
            }

            string monitorState = monitor.CurrentStateNameWithTemperature;

            base.Logger.OnMonitorState(monitor.GetType().Name, monitor.Id, monitorState, false, monitor.GetHotState());
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Notifies that a monitor entered a state.
        /// </summary>
        /// <param name="monitor">Monitor</param>
        internal override void NotifyEnteredState(Monitor monitor)
        {
            if (base.Configuration.Verbose <= 1)
            {
                return;
            }

            string liveness     = "";
            string monitorState = monitor.CurrentStateNameWithTemperature;

            if (monitor.IsInHotState())
            {
                liveness = "'hot' ";
            }
            else if (monitor.IsInColdState())
            {
                liveness = "'cold' ";
            }

            base.Log($"<MonitorLog> Monitor '{monitor.GetType().Name}' " +
                     $"enters {liveness}state '{monitorState}'.");
        }