/// <summary>
/// Remove a trace listener from SDK logging.
/// </summary>
/// <param name="source">The source the listener was added to.</param>
/// <param name="name">The name of the listener.</param>
public static void RemoveTraceListener(string source, string name)
{
if (string.IsNullOrEmpty(source))
{
throw new ArgumentException("Source cannot be null or empty", "source");
}
if (string.IsNullOrEmpty(name))
{
throw new ArgumentException("Name cannot be null or empty", "name");
}
lock (_traceListeners)
{
if (_traceListeners.ContainsKey(source))
{
foreach (var l in _traceListeners[source])
{
if (l.Name.Equals(name, StringComparison.Ordinal))
{
_traceListeners[source].Remove(l);
break;
}
}
}
}
Logger.ClearLoggerCache();
}