arcao / Syslog

An Arduino library for logging to Syslog server in IETF format (RFC 5424) and BSD format (RFC 3164)
MIT License
118 stars 48 forks source link

Mixing Strings and F()? #7

Closed MarcFinns closed 7 years ago

MarcFinns commented 7 years ago

Hello, I see that you support the F() macro. However, in some cases it would be great to be able to mix. For example: log("X value is " + String(X)); The statement above fails. When logging on serial i can work around the issue by having separate print + println for the two, but i cant do it with systlog. any hint? thanks!

arcao commented 7 years ago

Try this:

syslog.logf_P(PSTR("X value is %d"), X);
MarcFinns commented 7 years ago

Arcao, this works for %d. What can be done for Strings? I mean, concatenating a constant portion and a variable. I tries %s but does not work. thanks