How do I “Use Logger API to add logs to your proje

2019-01-27 21:33发布

I'm trying to see output of a script, but when I go to "View Logs" I get an alert "No logs found. Use Logger API to add logs to your project."

How do I add the Logger API?

enter image description here

2条回答
戒情不戒烟
2楼-- · 2019-01-27 21:58

You will want to add into your code

Logger.log("Yes, this was logged");

Also reference this page for more info: https://developers.google.com/apps-script/reference/base/logger

查看更多
我只想做你的唯一
3楼-- · 2019-01-27 22:01

Quote:

You need to have access to the Apps Script's Cloud Platform project in order to view the logs the script creates.

Apps Script Documentation - Logging Requirements

You can not just add:

console.log();

To your script and have it work.

From the "View" menu, choose "Console logs"

View - Console logs

You will be prompted to Enable Console Logging.

Enable Console Logging

查看更多
登录 后发表回答