Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constructor override is out-of-sync with Ruby 3.3.0's Logger class #13

Closed
st0012 opened this issue Mar 4, 2023 · 2 comments
Closed

Comments

@st0012
Copy link

st0012 commented Mar 4, 2023

After ruby/logger#85, Logger#initialize creates a @level_override = {} and access it every time level is called .

Since MonoLogger overrides the constructor but doesn't initialises the same @level_override variable, it now raises NoMethodError whenever level is called.

irb(main):001:0> require "mono_logger"
=> true
irb(main):002:0> MonoLogger.new(nil).level
/opt/rubies/3.3.0-dev/lib/ruby/3.3.0+0/logger.rb:385:in `level': undefined method `[]' for nil (NoMethodError)
                                                                                          
    @level_override[Fiber.current] || @level                                              
                   ^^^^^^^^^^^^^^^                                                        
        from (irb):2:in `<main>'                                                          
        from <internal:kernel>:187:in `loop'                                              
@st0012
Copy link
Author

st0012 commented Mar 6, 2023

Should be fixed by #12

@st0012
Copy link
Author

st0012 commented Mar 6, 2023

Closing as #12 has been merged

@st0012 st0012 closed this as completed Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant