Page 1 of 1

Programming JS Console.log doesn't work

Posted: 15 Dec 2022 22:32
by micky1500
Since ver 4x it doesn't work anymore !
Loglevel is set to '0'
debugPrint has been tried also.
Restarted z-way, Rebooted Pi, Power Cycled. !!

This used to work.
console.log("Alexa M.B. Room=" + vDev.get("location") + " SwitchBinary " + vDev.get("metrics:title"));

Am I missing something ?

Re: Programming JS Console.log doesn't work

Posted: 21 Dec 2022 03:44
by PoltoS
It should work. Do you see any lines in the log with [core]? If so, they are all printed with console.log (or debugPrint, which is same).

Maybe in your case one of the two values is null and nothing is printed then (since null + "anything" = null)?

Re: Programming JS Console.log doesn't work

Posted: 21 Dec 2022 19:39
by micky1500
Yes I see 22,000 [core] events. in 48 hours.
I changed it to console.log("Alexa Check"); , so no null's
It still doesn't work, That's when I scan for new devices.

I also checked the Daylight App, It's supposed to log the event times, I have not altered that one, but it still doesn't log the console.log entries.

It all used to work before 4.0.1, not sure if 4.0.0 worked. Definitely worked before.

Re: Programming JS Console.log doesn't work

Posted: 25 Dec 2022 11:35
by PoltoS
Are you sure your log-level in config.xml is 0?

Re: Programming JS Console.log doesn't work

Posted: 25 Dec 2022 11:35
by PoltoS
Are you sure your log-level in config.xml is 0?

Re: Programming JS Console.log doesn't work

Posted: 28 Dec 2022 02:16
by micky1500
Right now with 4.0.2 timestamped 28/04/2020
<log-level>0</log-level>
Same as before 4.0.1 with timestamp of years ago.

I just wondered if it was only me with the issue.
I have a working system, I will do a total rebuild sometime soon.
Thanks for your advice.

Re: Programming JS Console.log doesn't work

Posted: 29 Dec 2022 05:31
by PoltoS
It might be due to full SD card or logrotate log rotation