How to debug Google Apps Script (aka where does Logger.log log to?)

前端 未结 12 1841
时光说笑
时光说笑 2020-12-12 11:25

In Google Sheets, you can add some scripting functionality. I\'m adding something for the onEdit event, but I can\'t tell if it\'s working. As far as I can tell

12条回答
  •  半阙折子戏
    2020-12-12 11:58

    If you have the script editor open you will see the logs under View->Logs. If your script has an onedit trigger, make a change to the spreadsheet which should trigger the function with the script editor opened in a second tab. Then go to the script editor tab and open the log. You will see whatever your function passes to the logger.

    Basically as long as the script editor is open, the event will write to the log and show it for you. It will not show if someone else is in the file elsewhere.

提交回复
热议问题