aws / aws-lambda-ruby-runtime-interface-client

Other
73 stars 31 forks source link

Add missing level_override instance variable to logger #initialize #32

Open choosen opened 4 months ago

choosen commented 4 months ago

Adds compatibility for most recent, included in ruby 3.3.3 logger. https://github.com/ruby/logger/commit/7aabb0b4aaabea3e3a226092bdf92b60bf1c9d60

Issue

I've got 3.3.3 ruby with bundled Logger 1.6.0

eval error: undefined method `[]' for nil
  /Users/dev/.asdf/installs/ruby/3.3.3/lib/ruby/3.3.0/logger.rb:384:in `level'
  /Users/dev/.asdf/installs/ruby/3.3.3/lib/ruby/3.3.0/logger.rb:653:in `add'
  /Users/dev/.asdf/installs/ruby/3.3.3/lib/ruby/3.3.0/logger.rb:697:in `info'
  /Users/dev/.asdf/installs/ruby/3.3.3/lib/ruby/3.3.0/forwardable.rb:240:in `info'

there is missing empty hash in initialize.

Description of changes:

It should be compatible with previous versions of Ruby.

Target (OCI, Managed Runtime, both):

ruby 3.3.3 or most recent logger version. I run lambda in self hosted ruby container in general, but it is not required to test within docker, as code breaks on specs when applying LoggerPatch.


solves #33

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

choosen commented 2 months ago

@trivenay Can you look at it ?

choosen commented 2 months ago

or @briensea ?

choosen commented 2 months ago

logger 1.6.1 started to be compatible :) https://github.com/aws/aws-lambda-ruby-runtime-interface-client/issues/33#issuecomment-2324938107

if you want to be with bundled logger gem with 3.3 ruby please merge it, to not force for workarounds