Exemple #1
0
        protected bool GetLoggerEventForRunningCall(int iEventMRef, out LogEventEntry entry, out ServiceLogEventOptions logOptions)
        {
            EEntry e = _eRefs[iEventMRef];

            logOptions = e.LogOptions;
            bool isDisabled = _impl == null || _impl.Status == RunningStatus.Disabled;

            if (isDisabled || _impl.Status == RunningStatus.Stopped)
            {
                if ((logOptions & ServiceLogEventOptions.SilentEventRunningStatusError) != 0)
                {
                    entry = null;
                    if ((logOptions & ServiceLogEventOptions.LogSilentEventRunningStatusError) != 0)
                    {
                        _serviceHost.LogEventNotRunningError(e.Event, isDisabled);
                    }
                    return(false);
                }
                if (isDisabled)
                {
                    throw new ServiceNotAvailableException(_typeInterface);
                }
                else
                {
                    throw new ServiceStoppedException(_typeInterface);
                }
            }
            logOptions &= ServiceLogEventOptions.CreateEntryMask;
            entry       = logOptions != 0 ? _serviceHost.LogEventEnter(e.Event, logOptions) : null;
            return(true);
        }
Exemple #2
0
        protected bool GetLoggerEventForAnyCall(int iEventMRef, out LogEventEntry entry, out ServiceLogEventOptions logOptions)
        {
            EEntry e = _eRefs[iEventMRef];

            logOptions = e.LogOptions & ServiceLogEventOptions.CreateEntryMask;
            entry      = logOptions != 0 ? _serviceHost.LogEventEnter(e.Event, logOptions) : null;
            return(true);
        }
Exemple #3
0
        protected bool OnEventHandlingException(int iEventMRef, MethodInfo target, Exception ex, ref LogEventEntry ee)
        {
            EEntry e = _eRefs[iEventMRef];

            if ((e.LogOptions & ServiceLogEventOptions.LogErrors) != 0)
            {
                if (ee != null)
                {
                    _serviceHost.LogEventError(ee, target, ex);
                }
                else
                {
                    ee = _serviceHost.LogEventError(e.Event, target, ex);
                }
            }
            return((e.LogOptions & ServiceLogEventOptions.SilentEventError) != 0);
        }