コード例 #1
0
        private LogAttributeSettings GetLoggingLevels(
            LogAttribute[] assemblyLogAttributes, LogAttribute[] classLogAttributes, LogAttribute[] methodLogAttributes)
        {
            var logAttributeSettings = new LogAttributeSettings();
            logAttributeSettings = this.GetLoggingLevels(assemblyLogAttributes, logAttributeSettings);
            logAttributeSettings = this.GetLoggingLevels(classLogAttributes, logAttributeSettings);
            logAttributeSettings = this.GetLoggingLevels(methodLogAttributes, logAttributeSettings);

            return logAttributeSettings;
        }
コード例 #2
0
        private LogAttributeSettings GetLoggingLevels(LogAttribute[] logAttributes,
                                                      LogAttributeSettings logAttributeSettings)
        {
            foreach (LogAttribute logAttribute in logAttributes) {
                if (logAttribute.Settings.EntryLevel > logAttributeSettings.EntryLevel) {
                    logAttributeSettings.EntryLevel = logAttribute.Settings.EntryLevel;
                }
                if (logAttribute.Settings.SuccessLevel > logAttributeSettings.SuccessLevel) {
                    logAttributeSettings.SuccessLevel = logAttribute.Settings.SuccessLevel;
                }
                if (logAttribute.Settings.ExceptionLevel > logAttributeSettings.ExceptionLevel) {
                    logAttributeSettings.ExceptionLevel = logAttribute.Settings.ExceptionLevel;
                }
            }

            return logAttributeSettings;
        }