if (Logger.GetFilter<LogEnabledFilter>().Enabled) { // Logging is enabled. } else { // Logging is not enabled. } if (Logger.GetFilter<CategoryFilter>().ShouldLog(categories))//ICollection<string> categories; { // Event will be logged. } else { // Event will not be logged. } if (Logger.GetFilter<PriorityFilter>().ShouldLog(priority))//int priority; { // Event will be logged. } else { // Event will not be logged. } if (Logger.ShouldLog(logEntry))//汇总上面的过滤结果,判断是否应该过滤掉该事件 { // Perform possibly expensive operations gather information for the event to be logged. } else { // Event will not be logged. }