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.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment