Firebase Function console.log() output not showing up in include files

Viewed 761

I am working on some Firebase Functions and was able to get everything to work while all in my index.ts file. I had some console.log() calls to help me debug the code.

I have now moved some of my functions to outside .ts files for organization and imported them with:

const myFuncs = require('./myFuncs');

Now when my functions run, I am not getting any logging output in the Firebase Functions Logs tab. I can confirm that the code is working because my Firestore db is updating as expected.

Does console.log() not work from imported files? If not, what is the suggested way to log from imported files?

Thanks in advance for your help.

1 Answers

While the log output didn't show up in the Logs tab of the Firebase Functions console, I was able to see them when using

firebase functions:log

on the command line, so I just did that after the function executed.

Related