So, I have a script. It could be a post map, presave, what-have-you and I want to debug and see what things are at particular times in the script. There's an execution log for the scripts, but how do you write to the execution log so that you can send updates on the current status of the process?
Where you need to log, you would put console.log()
or console.debug()
. You may need to stringify the JSON if you need to log a non-string, so console.log(JSON.stringify(something))
. If you use console.debug
, then it only logs out when you enable debug for a period of time for the script. If you use console.log
, then it always logs. So console.log
isn’t completely recommended since it would always log, but you can also just make sure to comment that code out prior to production.
1 Like