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

Allow logging of partial raw data #56

Closed
rmarx opened this issue Feb 26, 2020 · 2 comments
Closed

Allow logging of partial raw data #56

rmarx opened this issue Feb 26, 2020 · 2 comments

Comments

@rmarx
Copy link
Contributor

rmarx commented Feb 26, 2020

Currently, we use the raw field in multiple events to allow logging of the raw data.

It would be interesting to allow logging for only the first x bytes, which can help in debugging.

Some options:

  1. New raw_partial field, containing the partial hex-encoded data
  2. New raw_length field, indicating the length of the raw field. If it doesn't match the length parameter (or equivalent), we know raw is truncated
  3. No new fields: we can derive raw's length from the size of the string. Then use similar logic as 2) to detect truncation
  4. No new fields, end raw field with ... at the end of the string. Perfectly human readable, bit of a hassle when decoding the bytes to e.g., ASCII + less optimal for a potential binary format

Personally, I would prefer 3. We will strongly advise AGAINST logging raw in typical usage scenarios anyway: it's only to be used for core debugging. In these latter cases, the person debugging probably knows the stack a bit more deeply and understands that it's logging just partial raw values.

cc @huitema

@rmarx
Copy link
Contributor Author

rmarx commented Sep 8, 2020

Related to #104 and #102

rmarx pushed a commit that referenced this issue Nov 2, 2020
@rmarx
Copy link
Contributor Author

rmarx commented Nov 2, 2020

Solved by allowing truncated values and specifying a separate length field (so basically option 2 above).

@rmarx rmarx closed this as completed Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant