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.

Closes asciidoctor#4493 .
  • Loading branch information
mtasaka committed Sep 29, 2023
1 parent 880f043 commit 4c93df1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/asciidoctor/logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class MemoryLogger < ::Logger
attr_reader :messages

def initialize
super nil
self.level = UNKNOWN
@messages = []
end
Expand Down Expand Up @@ -69,6 +70,7 @@ class NullLogger < ::Logger
attr_reader :max_severity

def initialize
super nil
self.level = UNKNOWN
end

Expand Down

0 comments on commit 4c93df1

Please sign in to comment.