[英]How to locally debug Google apps script?
I use clasp with VS Code to locally developing of Google Apps Script.我使用 VS Code 的 clasp 来本地开发 Google Apps 脚本。 It's too hard to use default code debugger.
使用默认代码调试器太难了。 So I'm looking for some way to debug code locally.
所以我正在寻找一些在本地调试代码的方法。 Any suggestions how can I do this?
有什么建议我该怎么做?
The short answer is there is no way to debug it as you would do in the editor .简短的回答是没有办法像在编辑器中那样调试它。
You can try to make workaround creating testing suites, or introducing various logs.您可以尝试解决创建测试套件或引入各种日志的方法。 But you cannot go step by step, inspecting variables as you would do normally.
但是您不能像往常一样一步一步地检查变量。
It's not the best, but I'm inserting这不是最好的,但我正在插入
SpreadsheetApp.getUi().prompt(varNeededToCheck);
If it's not the value you are expecting you can cancel the script or you can press OK to continue.如果它不是您期望的值,您可以取消脚本,或者您可以按 OK 继续。 It's a workaround and how I'm doing it.
这是一种解决方法,我是如何做到的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.