diff --git a/ChangeLog b/ChangeLog index 4a9d305339..f1dd0aec1f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Mar 9 00:07:03 2016 Nobuyoshi Nakada + + * lib/logger.rb (Logger::LogDevice#initialize): define using + keyword arguments. + Tue Mar 8 23:37:07 2016 Charles Oliver Nutter * test/ruby/test_array.rb: split out the test for no stack error diff --git a/lib/logger.rb b/lib/logger.rb index 5a310bacb5..8393806a11 100644 --- a/lib/logger.rb +++ b/lib/logger.rb @@ -629,13 +629,13 @@ private attr_reader :filename include MonitorMixin - def initialize(log = nil, opt = {}) + def initialize(log = nil, shift_age: nil, shift_size: nil) @dev = @filename = @shift_age = @shift_size = nil mon_initialize set_dev(log) if @filename - @shift_age = opt[:shift_age] || 7 - @shift_size = opt[:shift_size] || 1048576 + @shift_age = shift_age || 7 + @shift_size = shift_size || 1048576 @next_rotate_time = next_rotate_time(Time.now, @shift_age) unless @shift_age.is_a?(Integer) end end