Arduino-Log
Arduino-Log copied to clipboard
Fix CR LF definition
Hello,
Thank you for maintaining the lib, it is very handy !
Sorry if I missed something but it seems that CR and LF definition were inverted.
While this is technically correct, the historical examples gave CR
as the line terminator. This change breaks that behavior and, in PIO for instance, leads to the same line being overwritten endlessly.
Maybe change the examples to use "\n"
instead of CR
, but keep CR
(defined to be LF!) for compatibility with a warning comment next to its definition? (It's also a little antisocial to be defining an unqualified two letter symbol like that, but that's another matter...)
But it's kind of weird that CR/LF doesn't get added automatically-- is the idea that you could emit multiple log events to construct a single longer line? That doesn't work with prefixes, though. Honestly I'd suggest to strip any trailing CR/LF characters from log text, add CR/LF after the suffix always, make the .xxxln()
calls trivial passthrough to .xxx()
, and drop all the newline-related stuff from the documentation. This is what almost every other logging library in the universe does.