Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes bug where block was never executed even if message was nil

  • Loading branch information...
commit 5a6fefffe0aa6481c512f4bbac3c08a223abe899 1 parent 5f6c932
@runix runix authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/better_logging.rb
View
6 lib/better_logging.rb
@@ -117,6 +117,12 @@ def update_pid
def add_with_extra_info(severity, message = nil, progname = nil, &block)
update_pid
time = @@verbose ? "#{Time.now.iso8601(@@fraction_digits)} " : ""
+
+ if message.nil?
+ if block_given?
+ message = yield
+ end
+ end
message = "#{time}#{ActiveSupport::BufferedLogger.severity_name(severity)} #{message}"
# Make sure every line has the PID and hostname and custom string
Please sign in to comment.
Something went wrong with that request. Please try again.