Where does "print" print to?

Openhabian 3.2, UI:
I am awfully sorry for my stupid question and people may very well point out to me that I should spent my time with something else…
Nevertheless, I have started using blockly and try to debug my scripts. To do so I like to insert “print” commands.
But inserting a blockly “print” gives me a code like this


and I have no idea where it prints too. I tailed into openhab.log and event.log but see nothing.

Using the “log” block gives me an entry into the event.log and the openhab.log but that is no good as this is a mess with 100+ channels updating every 20 sec or so and seems not to be the right way to do it.

var logger = Java.type(‘org.slf4j.LoggerFactory’).getLogger(‘org.openhab.rule.’ + ctx.ruleUID);


The log messages should appear in the openhab.log. Your are most probably watching this log with frontail, that way you see events.log and openhab.log!
Using frontail you can easily filter the log-lines you see, using the ruleUID as a filter will show the lines from your rule only!

This question was asked here by the guy who’s developing a whole bunch of openHAB specific blocks for Blockly, but I couldn’t see an immediate answer…

Actually, found an answer

1 Like

correct, and I will document that accordingly in the final blockly reference docs.

THanks, I will learn about stdout, I guess I have to read a bit of Linux literature, I just throw my CP/M docs away and though I am done with that…
I do monitor the openhab.log too.
tail -f /var/log/openhab/openhab.log
That is less cluttered and "log"ing into that is a workaround…

If you are monitoring the openhab.log, just use the logger-statement or the blockly-log-block and don’t worry about the print statement too much.

… thanks, works ok

If you have a linux system that uses journalctl, you can see the output of a print statement by entering the following command on a terminal:

journalctl -u openhab -f

love it, if memory serves most of the good moves on cp/m involved calling pip with some parameters… has been a while though.