我想显示我的时间触发器触发的所有时间的日志。 我希望通过点击电子表格中的菜单来获取此信息。
答案 0 :(得分:0)
我会给你一个开始。这是我的实际logEntry函数。
function logEntry(entry,file)
{
var file = (typeof(file) != 'undefined')?file:'eventlog.txt';
var entry = (typeof(entry) != 'undefined')?entry:'No entry string provided.';
if(entry)
{
var ts = Utilities.formatDate(new Date(), "GMT-6", "yyyy-MM-dd' 'hh:mm:ss a");
var s = ts + ' - ' + entry + '\n';
myUtilities.saveFile(s, file, true);//s is string, file is filename, last parameter is whether to append or not. This utilize my own utilities library
}
}