如何调试云功能?functions.logger.log不工作



当用户更新chat/{id}文档时,此函数将执行。

const functions = require("firebase-functions");
exports.onChangedChat = functions.firestore
.document('chat/{id}')
.onWrite((change, context) => {
functions.logger.log("START!!!");

... some code ...
});

然而,函数以error结束。所以现在我试图找到错误的原因,但functions.logger.log没有显示在Firebase控制台。

关于上面的例子。当调用该函数时,应该显示日志"START!!!"。如下图所示:

onChangedChat: Function execution started

onChangedChat:函数执行耗时16 ms。完成状态:error

"START!!!"在哪里?

如果发生错误,则不会显示所有日志。注释掉... some code ...后,functions.logger.log()工作了。

最新更新