Skip to content

Feature request: Logger shouldn't discard nonprintable characters #196

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

Open
vaclavbartos opened this issue Nov 25, 2022 · 0 comments
Open

Comments

@vaclavbartos
Copy link
Contributor

Currenlty, logger module (or rather unirec2csv functionality in Nemea-Framework) doesn't show non-printable characters in string-type fields. They are quietly discarded (see line 160). Similarly, new-line characters (\n) are converted to spaces (line 149).

I think this behavior is quite bad for debugging, as it hides a potentially important information (we're just dealing with a bug where there is \r at the end of some fields and it would help a lot if logger showed it).

I propose to print such characters using \x00 format or something silimar. (Maybe \u0000 if I remember correctly that string fields are expected to be in UTF-8 encoding?)

It needs some discussion though, as it's a change of behavior which can potentially break something (although I think it's not likely). And a corresponding change in logreplay may be necessary, if we want to keep that anything logged by logger can be replayed by logreplay.

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

No branches or pull requests

1 participant