lib/semantic_logger/base.rb in semantic_logger-4.3.0 vs lib/semantic_logger/base.rb in semantic_logger-4.3.1

- old
+ new

@@ -205,10 +205,14 @@ # :nodoc: def tags SemanticLogger.tags end + def named_tags + SemanticLogger.named_tags + end + # Returns the list of tags pushed after flattening them out and removing blanks # # Note: # - This method is slow since it needs to flatten the tags and remove empty elements # to support Rails 4. @@ -299,16 +303,10 @@ # Whether to log the supplied message based on the current filter if any def filtered?(log) return false if @filter.nil? - if @filter.is_a?(Regexp) - (@filter =~ log.name).nil? - elsif @filter.is_a?(Proc) - @filter.call(log) != true - else - raise(ArgumentError, "Unrecognized semantic logger filter: #{@filter.inspect}, must be a Regexp or a Proc") - end + @filter.is_a?(Regexp) ? (@filter =~ log.name).nil? : @filter.call(log) != true end # Ensure minimum log level is met def meets_log_level?(log) (level_index <= (log.level_index || 0))