lib/semantic_logger/appender/base.rb in semantic_logger-2.11.0 vs lib/semantic_logger/appender/base.rb in semantic_logger-2.12.0

- old
+ new

@@ -79,10 +79,16 @@ def flush # An appender can implement a flush method if it supports it. end + # Returns the current log level if set, otherwise it returns the global + # default log level + def level + @level || :trace + end + ############################################################################ protected # Initializer for Abstract Class SemanticLogger::Appender # @@ -101,9 +107,16 @@ @formatter = block || default_formatter # Appenders don't take a class name, so use this class name if an appender # is logged to directly super(self.class, level, filter) + end + + # Return the level index for fast comparisons + # Returns the lowest level index if the level has not been explicitly + # set for this instance + def level_index + @level_index || 0 end # For JRuby include the Thread name rather than its id if defined? Java # Return the Time as a formatted string \ No newline at end of file