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 #73.

Signed-off-by: Mamoru TASAKA <[email protected]>
  • Loading branch information
mtasaka committed Jun 26, 2024
1 parent 29fb37a commit 139b79c
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 139b79c

Please sign in to comment.