예제 #1
0
        public void Logger_AddRemoveOverride()
        {
            const string name         = "LoggerOverrideTest";
            const string fullName     = "Runtime." + name;
            var          logger       = TraceLogger.GetLogger(name, TraceLogger.LoggerType.Runtime);
            var          initialLevel = logger.SeverityLevel;

            TraceLogger.AddTraceLevelOverride(fullName, Severity.Warning);
            Assert.AreEqual(Severity.Warning, logger.SeverityLevel, "Logger level not reset after override added");

            TraceLogger.RemoveTraceLevelOverride(fullName);
            Assert.AreEqual(initialLevel, logger.SeverityLevel, "Logger level not reset after override removed");
        }