mattneub/appscript — pull request #4 by abarnert (2012-10-05 19:07:59+00:00)
Title: objc-appscript: Added a way to truncate descriptions of long data descriptors.

- Added one method, `+[AEMObjectRenderer setDataDescriptionTruncation:]`.
When set to `maxBytes`, this affects the description of any descriptor
that describes as hex bytes, so that only the first `maxBytes` will be
displayed, followed by an ellipsis.

- This is primarily useful when debugging AE interfaces that send
large hunks of binary data around, such as iTunes cover art. The
first few bytes of the artwork's data object are enough to tell
whether you're getting a PNG or a PICT; the remaining 200K chars do
nothing but make the logs harder to read and search.

- Since the data descriptor may be embedded in some other object, the
most reasonable place to put the truncation is inside its
`description` (or, rather, in `+[formatObject:indent:result:]`, the
recursive function that does the actual formatting underlying
`description`).

- Truncation is off by default, because sometimes you _do_ want all
200K (e.g., so you can parse the logs, unhexlify the bytes, save
them as a file, and see if they're the PICT you expected).