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
Use decodeUtf8'
to check whether bytestrings are printable before logging
#952
Use decodeUtf8'
to check whether bytestrings are printable before logging
#952
Conversation
utfEncode'
to log bytestringsutfEncode'
to check whether bytestrings are printable before logging
utfEncode'
to check whether bytestrings are printable before loggingdecodeUtf8'
to check whether bytestrings are printable before logging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add an entry to lib/amazonka/CHANGELOG.md
, which is the master changelog for the project?
Also, are we sure that this is the correct check to make? What if the user's terminal is set to some other encoding scheme? A TextEncoding (as returned by System.IO.hGetEncoding
) isn't even in Eq
, so I'm not sure what the best way is to fix this. I suspect what we have here might be a bit too naive; do you have any thoughts about other ways we could check this? It may also be the case that we successfully decode UTF-8 but it's got non-printable characters in it; do we want to do that check here too?
In the medium term, I probably want to extract logging from the main amazonka library so that people can use whatever logging framework suits them. Then handling non-printable stuff becomes the log library's concern.
I've updated the changelog and added a section |
6354cd3
to
525f730
Compare
525f730
to
e6446f5
Compare
I've added another check with
that'd be great. |
@endgame are we OK with the latest state of this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this, and sorry for the delay.
closes #947
on my local tests targeting localstack, below are the results when I hit the
PutMetricData
endpoint via a gzipped wrapperor, when the data is printable (no gzipped payload):