Exemple #1
0
        public void RemoveLogDestination(ILogDestination logDestination)
        {
            if (logDestination != null)
            {
                if (logDestination.IsRunning)
                {
                    logDestination.Stop();
                }

                lock (_destinations)
                {
                    var index = _destinations.FindIndex(d => d.Id == logDestination.Id);

                    if (index > -1)
                    {
                        _destinations.RemoveAt(index);
                    }
                    else
                    {
                        Log(string.Format("Unable to remove LogDestination, cannot find destination with an id of \"{0}\".", logDestination.Id), LogMessageSeverity.Warning);
                    }
                }
            }
            else
            {
                Log("Cannot remove Null LogDestination...", LogMessageSeverity.Error);
            }
        }