[DO NOT MERGE] Compatibility with stdlib logger when using block arguments.

The change concerning this PR is in 1938f23, the rest are just the lost commits (see #2). Once #2 is resolved, I will rebase this and possibly rework it w.r.t. any logger API changes in Ruby 2.0.