Пример #1
0
        public static IDisposable PushProperty(string name, string value)
        {
            ConcurrentDictionary <string, IEnricher> stack = GetOrCreateEnricherStack();
            var bookmark = new StackBookmark(Clone(stack));

            stack[name] = new ConstantEnricher(name, value);

            Enrichers = stack;

            return(bookmark);
        }
Пример #2
0
        public static IDisposable Push(IEnumerable <KeyValuePair <string, string> > properties)
        {
            ConcurrentDictionary <string, IEnricher> stack = GetOrCreateEnricherStack();
            var bookmark = new StackBookmark(Clone(stack));

            if (properties != null)
            {
                foreach (KeyValuePair <string, string> pair in properties)
                {
                    stack[pair.Key] = new ConstantEnricher(pair);
                }
            }

            Enrichers = stack;

            return(bookmark);
        }