Created
February 22, 2010 06:21
-
-
Save ruckus/310861 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MySQL BLOB logging filter. | |
# | |
class ActiveRecord::ConnectionAdapters::AbstractAdapter | |
# Replace BLOB portion of message with "BLOB(n bytes)". | |
# | |
# ==== Paramters | |
def format_log_entry_with_blob_filter(message, dump = nil) | |
dump.gsub!(/x'[^']+'/) { |blob| "BLOB(#{(blob.length-3)/2} bytes)" } if dump | |
format_log_entry_without_blob_filter(message, dump) | |
end | |
alias_method_chain :format_log_entry, :blob_filter | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment