Gregory Nutt
1c9859520f
syslog: There is yet another place where the output can get split. That is in syslog_dev_write(): It will break up the stream to insert a CR before the LF. This can that can be avoid be generating the CR-LF sequence in the buffer and then detecting and ignoring valid CR-LF sequences, rather than expecting syslog_dev_write() to insert the CR in this case.
...
I don't like the idea that syslog_dev_write() still scans the entire output buffer to expand CR-LF sequence. This seems really wasteful, especially in this case where we can be sure that the is no CR or LF without a matching LF or CR. Bu, I think, the existing behavior in syslog_dev_write() must be retained because it is needed in other contexts.
2017-05-12 07:31:50 -06:00
Gregory Nutt
0fc068cc9c
syslog: Avoid flushing syslog_stream buffer, if possible, until lib_vsprintf() completely parses the format. This assures that the flush will flush the entire output, even data that may potentially follow the linefeed. And, in that case, it cannot be interleaved with other devug output. Suggested by Jussi Kivilinna.
2017-05-12 06:58:33 -06:00
Jussi Kivilinna
ba933efd9e
When syslog message has addition characters after last new-line. With buffering those now get lost as vsyslog does not flush output after lib_sprintf. Additional trailing characters could be ANSI escape sequence to reset state that message setups. For example, macro here uses colors and resets state after actual message (including '\n'):
...
With flushing added to vsyslog, then there is problem that next syslog line might come from other task before reset sequence, causing wrong line getting color. This could be avoided by not flushing on '\n' but only if IOB is full and/or at end of vsyslog. Would this make sense?
2017-05-11 07:11:35 -06:00
Gregory Nutt
d3b9f5b37f
Syslog buffering: Use IOBs to buffer data, not an on-stack buffer
2017-05-10 17:36:08 -06:00
Gregory Nutt
d8a83f16be
Syslog buffering: Various corrections from early debug
2017-05-10 16:13:21 -06:00
Gregory Nutt
20727d17c3
SYSLOG: Add option to buffer SYSLOG output to avoid interleaving.
2017-05-10 14:42:43 -06:00
Gregory Nutt
9f859774a1
setvbuf: Add support for configuration of line buffering.
2017-02-08 11:28:24 -06:00
Gregory Nutt
cf1375daf7
Break syslog_channel.c up into syslog_channel.c, syslog_putc.c, syslog_force.c and syslog_flush.c to limited what is brought into the link. Separate syslog_emergstream.c from syslog_stream.c. Didn't help in the case I was looking at.
2016-06-20 17:10:52 -06:00
Gregory Nutt
505ca542e8
Remove some last traces of lowvsyslog that were missed; Add a SYSLOG emergency channel for handling assertion output more cleanly
2016-06-20 16:11:50 -06:00
Gregory Nutt
9a19d64610
Reanem syslogstream.c to syslog_steam.c for consistency
2016-06-19 18:19:34 -06:00