lib/semantic_logger/logger.rb in semantic_logger-2.7.0 vs lib/semantic_logger/logger.rb in semantic_logger-2.8.0
- old
+ new
@@ -31,12 +31,16 @@
#
# level
# The initial log level to start with for this logger instance
# Default: SemanticLogger.default_level
#
- def initialize(klass, level=nil)
- @name = klass.is_a?(String) ? klass : klass.name
- self.level = level || SemanticLogger.default_level
+ # filter [Regexp|Proc]
+ # RegExp: Only include log messages where the class name matches the supplied
+ # regular expression. All other messages will be ignored
+ # Proc: Only include log messages where the supplied Proc returns true
+ # The Proc must return true or false
+ def initialize(klass, level=nil, filter=nil)
+ super
end
# Returns [Integer] the number of log entries that have not been written
# to the appenders
#