是否可以导出Google Apps脚本执行记录 [英] Is it possible to export Google Apps Script Execution transcript

查看:106
本文介绍了是否可以导出Google Apps脚本执行记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个网络应用程序脚本,该应用程序脚本被部署为在用户访问网络应用程序的情况下运行。

是否可以以编程方式导出网络应用程序脚本的执行副本?

解决方案

不直接。

你不会得到一个完整的堆栈跟踪,但你可以用Logging记录你想要通知的所有内容。在脚本结尾处,您可以提取日志并发送邮件。



Logger.getLog();



如果你真的想成为,自定义Logger的一些实现扩展了标准Logger.log()。例如,如果每次向它发送日志消息时都有一个对象,它会将整个持续时间,自上次日志以来的时间和传递给它的消息都标记为Logger.log。同样的对象可以有一个自己的getLog(0方法,它做了额外的东西 - 如果你愿意的话)。



Google Apps Script Examples

但是总之,不能,你不能导出执行日志。


I have a written a web Apps Script which is deployed to run in the context of user accessing the web app.

Is it possible to export web Apps Script's Execution Transcript programatically?

解决方案

Not directly.

You won't get a full stack trace, but you can be meticulous with Logging everything you want to be notified with. At the end of the script you could extract the log and email that.

Logger.getLog();

If you really wanted to be fancy, there are a few implementations of custom Loggers which extent the standard Logger.log(). For instance if you had an object that every time you send a log message to it, it would time-stamp overall duration, time since last log and the message passed to it, all to Logger.log. Same object could have a getLog(0 method of its own which did extra stuff - should you wish.

There is a notable logger library at Google Apps Script Examples by Peter Herrmann which will also allow you to log to a spreadsheet.

But in short, no, you cannot export the execution log.

这篇关于是否可以导出Google Apps脚本执行记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆