Skip to content

Conversation

@saraid
Copy link
Contributor

@saraid saraid commented Aug 19, 2024

Some Ruby apps subclass Logger without running the superclass constructor, which means that @level_override isn't initialized properly. This can be fixed in some cases, but the gem should maintain backwards compatibility.

My repro is from using Chef v12, but this should also address #99.

SEV_LABEL[severity] || 'ANY'
end

def level_override
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you comment that reason to extract level_override as method at this place?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do.

@saraid saraid force-pushed the guarantee-level_override-existence branch from 4449bce to a114504 Compare August 20, 2024 22:23
Some Ruby apps subclass Logger without running the superclass
constructor, which means that `@level_override` isn't initialized
properly. This can be fixed in some cases, but the gem should maintain
backwards compatibility.
@saraid saraid force-pushed the guarantee-level_override-existence branch from a114504 to 3246f38 Compare August 20, 2024 22:24
@saraid
Copy link
Contributor Author

saraid commented Aug 20, 2024

Sorry about the force-pushes; didn't realize I'd used the wrong email on the commits.

@hsbt hsbt merged commit d5400dd into ruby:master Aug 21, 2024
@atrzaska
Copy link

when can we expect 1.6.1? without this aws lambda runtime breaks with the latest version of activesupport which now depends on logger rails/rails@d9adf17

@saraid
Copy link
Contributor Author

saraid commented Aug 31, 2024

@hsbt If there's anything additional I need to do, please let me know.

@hsbt
Copy link
Member

hsbt commented Sep 2, 2024

Done

@nobu
Copy link
Member

nobu commented Feb 14, 2025

Some Ruby apps subclass Logger without running the superclass constructor, which means that @level_override isn't initialized properly.

This sounds like a definite bug obviously.

nobu added a commit that referenced this pull request Feb 14, 2025
Warn wrong code, #100:
> Some Ruby apps subclass Logger without running the superclass
> constructor, which means that `@level_override` isn't initialized
> properly.
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

Successfully merging this pull request may close these issues.

4 participants