graylog-labs / gelf-rb

Ruby GELF library (Graylog Extended Log Format)
https://rubygems.org/gems/gelf
MIT License
153 stars 104 forks source link

Make GELF::Logger#add compatible with Logger#add #27

Closed mrnugget closed 9 years ago

mrnugget commented 9 years ago

This changes the interface of GELF::Logger#add to be the same as Ruby's Logger#add.

Before the change the GELF::Logger would loose messages if its #add method was used like Logger#add.

This changes the code to use the new interface and uses the same technique as Ruby's Logger#add to check for messages and facilities in the body of #add.

For more information: https://github.com/Graylog2/gelf-rb/issues/26

I really hope this doesn't break anything, since I changed assertions in the tests to conform to the Ruby Logger interface. I also hope I didn't make a mistake while doing this. Careful review would be appreciated :)

mrnugget commented 9 years ago

By the way, I already signed the Contribution Agreement.

joschi commented 9 years ago

CLA has been signed.

Thanks for your PR!

mrnugget commented 9 years ago

Thanks a lot for merging this!

siawyoung commented 9 years ago

Hi, I'm facing an issue with this as well. I'm trying to use gelf as an dependency in a gem I'm writing but it seems 1.4.0 doesn't have this patch. Is it possible to publish the updated gem? Thanks!