Skip to content

Commit

Permalink
Support ruby3.3 Logger by properly initialize super class
Browse files Browse the repository at this point in the history
Upcoming ruby3.3 will have enhanced Logger class:
ruby/ruby@194520f
which initializes newly added instance variables.
Without initializing such variables (in super class), now using
subclass of Logger will cause exception.

To avoid this, first call super, then execute additional subclass
initialization.

Fixes chef#73.

Signed-off-by: Mamoru TASAKA <mtasaka@fedoraproject.org>
  • Loading branch information
mtasaka committed Sep 26, 2023
1 parent 8643e33 commit 715f956
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/mixlib/log/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ def trace?; @level <= TRACE; end
# Create an instance.
#
def initialize(logdev)
@progname = nil
@level = DEBUG
@default_formatter = Formatter.new
@formatter = nil
@logdev = nil
super(nil)
if logdev
@logdev = LocklessLogDevice.new(logdev)
end
Expand Down

0 comments on commit 715f956

Please sign in to comment.