/// <summary> /// Фиксирует состояние сервиса. /// </summary> /// <param name="service">Сервис, для которого производится регистрация состояния.</param> /// <param name="serviceStatus">Состояние сервиса.</param> /// <param name="serviceStatusDetailed">Детализированное состояние сервиса.</param> /// <param name="exception">Ошибки, если были зарегистрированы.</param> public void RegisterServiceState(IMonitoredService service, ServiceStatus serviceStatus, string serviceStatusDetailed = null, Exception exception = null) { RegisterServiceStateWithoutJournal(service, serviceStatus, serviceStatusDetailed); var eventType = EventType.Info; if (serviceStatus == ServiceStatus.RunningIdeal) { eventType = EventType.Info; } else if (serviceStatus == ServiceStatus.RunningWithErrors) { eventType = EventType.Error; } else if (serviceStatus == ServiceStatus.CannotRunBecouseOfErrors) { eventType = EventType.CriticalError; } else if (serviceStatus == ServiceStatus.Shutdown) { eventType = EventType.Info; } RegisterServiceEvent(service, eventType, serviceStatus.ToStringFriendly(), serviceStatusDetailed, exception); }