Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abarnert
Copy link

@abarnert abarnert commented Oct 5, 2012

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

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

Successfully merging this pull request may close these issues.

1 participant