Skip to content

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

@vaclavbartos

Description

@vaclavbartos

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions