Amazon.Runtime.Internal.Util.Logger.ClearLoggerCache C# (CSharp) Метод

ClearLoggerCache() публичный статический Метод

public static ClearLoggerCache ( ) : void
Результат void
        public static void ClearLoggerCache()
        {
            lock (cachedLoggers)
            {
                cachedLoggers = new Dictionary<Type, Logger>();
            }
        }

Usage Example

Пример #1
0
        /// <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();
        }