lib/logging/logger.rb in logging-0.2.0 vs lib/logging/logger.rb in logging-0.3.0

- old
+ new

@@ -1,6 +1,6 @@ -# $Id: logger.rb 22 2007-01-29 16:20:54Z tim_pease $ +# $Id: logger.rb 25 2007-01-30 20:19:12Z tim_pease $ require 'thread' require 'logging' require 'logging/appender' require 'logging/log_event' @@ -98,17 +98,17 @@ code << "undef :#{name}? if method_defined? :#{name}?\n" if logger.level > num code << <<-CODE def #{name}?( ) false end - def #{name}( *args ) false end + def #{name}( data = nil ) false end CODE else code << <<-CODE def #{name}?( ) true end - def #{name}( *args ) - args.push yield if block_given? - log_event(::Logging::LogEvent.new(@name, #{num}, args, @trace)) unless args.empty? + def #{name}( data = nil ) + data = yield if block_given? + log_event(::Logging::LogEvent.new(@name, #{num}, data, @trace)) unless data.nil? true end CODE end