How to log a formatted string with "\n"?

Hello all!

I want to output a formatted message in Robomotion with a new line carrier. So, I want the string

“Hello\nWorld!”

to be logged (it doesn’t matter if in EVENTS tab - using Log node - or OUTPUT tab - using Debug node) this way:

Hello
World

I’ve stored the string in a msg JSON field and the “\n” is ignored in the output by both nodes (Log or Debug).

I just want an output that respects “\n” in the string message. There is a way to accomplish that?

Thanks in advance!

Debug displays a JSON object, so you cant see newline there.

But if you use Log node you can write to logs files of the robot with newlines

image

File System → Write File would also be another alternative.

Did a test exactly as shown, but the log in Events tab (I’m using the last version of Chrome on Mac) ignores line break completely. Although Write File works. Thanks for the tip!