appscript icon indicating copy to clipboard operation
appscript copied to clipboard

objc: Added a way to truncate descriptions of long data descriptors.

Open abarnert opened this issue 13 years ago • 0 comments

  • 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).

abarnert avatar Oct 05 '12 19:10 abarnert