Skip to content

processing newline char #28

Open
Open
@sanderkob

Description

@sanderkob

I use existing code to prepare my syslog messages. That code was written to send debug output to the serial port.
In the code the\ncharacter sequence is used to generate a linefeed.
The relevant code that sends a string containing the sequence \n is

    String syslogstring =  "Number of repeats\n";
    syslogstring += NrRepeats; // in this case 2
    syslog.log(LOG_INFO,syslogstring.c_str());

The output shows:
Number of repeats#0122

I solve it my replacing the \n before submitting to syslog:
syslogstring.replace("\n", " ");
The output then shows:
Number of repeats 2
So I have no problem, but I would like to know how syslog processes the \n sequence.
It was not clear from the syslog code, I must have overlooked something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions