Skip to content

[C++] Check if CHAR fields are printable #715

Closed
@trozen

Description

@trozen

Sometimes I'm getting messages with CHAR fields, that are set to 0 for example. This breaks logging, as binary data is mixed with text.

Would it be possible to change the way CHAR fields are printed currently:

            builder << '"' << (char)writer.tradeCondition() << '"';

to something like:

            if (std::isprint(writer.tradeCondition())) {
                builder << '"' << (char)writer.tradeCondition() << '"';
            } else {
                builder << (int)writer.tradeCondition();
            }

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