public LogDomainVerbosityCollection(XmlNodeList data)
        {
            foreach (XmlNode node in data)
            {
                var domain       = node.Name;
                var verbosityStr = CouchbaseConfigSection.GetNamedAttribute(node, "verbosity");
                if (verbosityStr == null)
                {
                    Log.To.NoDomain.W(Tag, "Invalid element {0} (missing 'verbosity') in" +
                                      " configuration file, skipping...", domain);
                    continue;
                }

                Log.LogLevel level;
                if (!Enum.TryParse <Log.LogLevel>(verbosityStr, true, out level))
                {
                    Log.To.NoDomain.W(Tag, "Invalid verbosity {0} ({1}) in configuration file.  " +
                                      "Valid values are normal, verbose, debug", verbosityStr, domain);
                    continue;
                }

                if (_values.ContainsKey(domain))
                {
                    Log.To.NoDomain.W(Tag, "Duplicate entry for {0} detected, ignoring {1} setting...",
                                      domain, verbosityStr);
                    continue;
                }

                _values.Add(domain, level);
            }
        }
#pragma warning disable 1591

        public object Create(object parent, object configContext, XmlNode section)
        {
            var retVal = new CouchbaseConfigSection();
            foreach (XmlNode childNode in section.ChildNodes) {
                if (childNode.Name.ToLowerInvariant() == "logging") {
                    retVal.Logging = new LogConfigSection(childNode);
                } else {
                    Log.To.NoDomain.W(Tag, "Unknown element {0} found in configuration file", childNode.Name);
                }
            }

            return retVal;
        }
        public object Create(object parent, object configContext, XmlNode section)
        {
            var retVal = new CouchbaseConfigSection();

            foreach (XmlNode childNode in section.ChildNodes)
            {
                if (childNode.Name.ToLowerInvariant() == "logging")
                {
                    retVal.Logging = new LogConfigSection(childNode);
                }
                else
                {
                    Log.To.NoDomain.W(Tag, "Unknown element {0} found in configuration file", childNode.Name);
                }
            }

            return(retVal);
        }
        public LogConfigSection(XmlNode data)
        {
            var enabledStr = CouchbaseConfigSection.GetNamedAttribute(data, "enabled");

            if (enabledStr == null || !Boolean.TryParse(enabledStr, out _enabled))
            {
                _enabled = true;
            }

            var verbosityStr = CouchbaseConfigSection.GetNamedAttribute(data, "verbosity");

            if (enabledStr == null || !Enum.TryParse <Log.LogLevel> (verbosityStr, true, out _logLevel))
            {
                _logLevel = Log.LogLevel.Base;
            }

            var scrubSensitivityStr = CouchbaseConfigSection.GetNamedAttribute(data, "scrubSensitivity");

            if (scrubSensitivityStr == null || !Enum.TryParse <LogScrubSensitivity> (scrubSensitivityStr, true, out _scrubSensitivity))
            {
                _scrubSensitivity = LogScrubSensitivity.NoInsecure;
            }

            _verbositySettings = new LogDomainVerbosityCollection();
            foreach (XmlNode childNode in data.ChildNodes)
            {
                if (childNode.Name == "domains")
                {
                    _verbositySettings = new LogDomainVerbosityCollection(childNode.ChildNodes);
                }
                else
                {
                    Log.To.NoDomain.W(Tag, "Unknown element {0} found in configuration file", childNode.Name);
                }
            }
        }