如何为应用脚本函数分配执行类型

huangapple go评论74阅读模式
英文:

How to assign Execution Type to Apps Script functions

问题

我需要每天检查我的Apps Script插件的执行日志。我的onOpen()函数有很多执行次数(用户在我的办公室打开工作表文档时都会执行),我想隐藏这些执行记录。我尝试过过滤执行类型并选择除了"简单触发器"之外的所有选项,但这样一来我就无法看到其他由用户触发的函数,因为我的插件函数的类型被设置为"未知"(而"未知"不在过滤列表中)。是否可以将插件函数分配给列表中的某个类型,或以其他方式隐藏"简单触发器"?

谢谢!

英文:

I have to daily check the execution log of my Apps Script Addon. I have a lot of executions of the onOpen() function (always a user opens a sheet document in my office), and I want to hide these executions. I tried filtering execution Type and checking all the options except Simple Triggers, but then I can't see the rest of functions triggered by users, because the Type of my addon functions are set as "Unknown" (and unknown is not in the filter list). It's possible to assign a type of the list to the addon functions, or hide the Simple Triggers in another way?

Thanks!

答案1

得分: 2

我不认为可以设置执行类型。但是,您可以使用URL来按执行类型进行筛选。格式如下:

https://script.google.com/home/projects/{PROJECT_ID}/executions?type={TYPE_ID}[.{TYPE_ID}]

其中

  • PROJECT_ID 是项目的ID。例如:t1cjovovstuxihcohciyc1h_66hg
  • TYPE_ID 是执行类型的ID。例如:1 代表 ADD_ON7 代表 WEB_APP

例如,要筛选插件或Web应用程序类型的执行,使用以下URL:

https://script.google.com/home/projects/t1cjovovstuxihcohciyc1h_66hg/executions?type=1.7

要筛选“未知”类型的执行,请使用类型ID 0

https://script.google.com/home/projects/t1cjovovstuxihcohciyc1h_66hg/executions?type=0

您还可以直接使用Google云Stackdriver日志,提供更多筛选功能,前提是将您的GCP切换到标准模式。

英文:

I don't think it's possible to set a execution type. However, You can use the url to filter by execution type. The format is:

https://script.google.com/home/projects/{PROJECT_ID}/executions?type={TYPE_ID}[.{TYPE_ID}]

where

  • PROJECT_ID is the id of the project. Eg: t1cjovovstuxihcohciyc1h_66hg
  • TYPE_ID is the id of the execution type. Eg: 1 for ADD_ON, 7 for WEB_APP

For eg, To filter in executions of type Addon OR Webapp, use

https://script.google.com/home/projects/t1cjovovstuxihcohciyc1h_66hg/executions?type=1.7

To filter in "Unknown" type executions, use type id 0

https://script.google.com/home/projects/t1cjovovstuxihcohciyc1h_66hg/executions?type=0

You can also directly use the Google cloud stackdriver logging, which offers much more filtering features, provided you change your GCP to standard.

huangapple
  • 本文由 发表于 2023年4月11日 00:49:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/75978978.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定