Skip to content

Instantly share code, notes, and snippets.

@rafaelp
Created June 9, 2012 18:07
Show Gist options
  • Save rafaelp/2902006 to your computer and use it in GitHub Desktop.
Save rafaelp/2902006 to your computer and use it in GitHub Desktop.

Revisions

  1. rafaelp created this gist Jun 9, 2012.
    18 changes: 18 additions & 0 deletions aws_sdk_log_formatter.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    module AWS
    module Core
    class LogFormatter
    # @param [Object] value
    # @return [String]
    def summarize_value value
    case value
    when String then summarize_string(value)
    when Hash then '{' + summarize_hash(value) + '}'
    when Array then summarize_array(value)
    when File then summarize_file(value.path)
    when Pathname then summarize_file(value)
    else value.to_s.force_encoding('UTF-8').inspect
    end
    end
    end
    end
    end