Best way to make BLYNK_LOG() without new line

I need a easy way to use BLYNK_LOG but without adding a new line.

I would use it to add custom code when debugging the communication, example:

(05:00:31) TMP [95581]<[14|00|B1|00|0B]vw[00]6[00]31.400

(05:00:31) TMP is added by me.

Currently I use BLYNK_PRINT.print() but it is not practical because it breaks my code when I comment out => #define BLYNK_PRINT Serial.

Kind Regards

Not sure I follow you… you want to use the BLYNK_LOG() feature, but you want it to still work when it’s necessarily prerequisite BLYNK_PRINT() is turned off?

I don’t think you can have one without the other.

http://docs.blynk.cc/#blynk-firmware-debugging-blynk_log

Too much text from my side… actually I just need a BLYNK_LOG function which is not doing a new line

BLYNK_LOG("HELLO");
BLYNK_LOG("WORLD");

Desired Output => "HELLO WORLD"

Current Output =>
"HELLO"
"WORLD"

Kind Regards

Again, not sure I am understanding the problem… use:

BLYNK_LOG("HELLO WORLD");

Then I can not attach it to the same line where the communication output is =>

Blynk.virtualWrite(virtualPin, value);

More info:

Blynk.virtualWrite(virtualPin, value); is delivering something like => [95581]<[14|00|B1|00|0B]vw[00]6[00]31.400 right? You’ve seen such output I guess.

Now I want to attach the name of the pin in front of it, so i use BLYNK_PRINT.print() but I want to use BLYNK_LOG instead. This is not possible as BLYNK_LOG makes a new line.

Did I manage to explain my issue now?

I was going throguh your previous posts, trying to understand… then it hit me, just what you meant by “attach it to the same line” (as in serial output line, not sketch command line ;P), just before you clarified it.

However I don’t know if there is an answer for your need… if so it would probably mean hacking the library that generates the log output to modify end-of-line commands, etc

Yeee finally!!! Sometimes is not easy to explain even when it sounds very simple…Text has its limitations.

Maybe they could add a BLYNK_LOG and BLYNK_LOGLN in the next version :smiley:
Kind Regards

1 Like