How to debug a script ?

I added script in /system logging but I see nothing in the log window when I execute a script.
What is missing ?

Hi

You’ll need to add some logging code into your script example:

:log info “Hello world!”

Can I display variables ?

:log info “Variable $var”

Sure
:local msg “world!”
:log info “Hello $msg”

:do { ***command*** } on-error={ ***run if error command*** }

also you can run “/system script print” to do a syntax debug.