I have a node script that prints logs generated by all my firebase cloud functions.
const { execSync } = require("child_process");
const cmd = "firebase functions:log";
let options = {
encoding: 'utf8'
}
let output = execSync(cmd, options)
console.log(output)
Outputs look something like this:
2021-01-06T09:06:05.541212726Z D saveGarment: Function execution took 736 ms, finished with status code: 204
2021-01-06T09:06:10.844901031Z D saveGarment: Function execution started
2021-01-06T09:06:16.153Z ? saveGarment: CORE
2021-01-06T09:06:18.134508823Z D saveGarment: Function execution took 7470 ms, finished with status code: 200
2021-01-06T09:06:19.546Z ? saveGarment: { message: 'fail' }
The output of the script is in the form of a string. Is there any way to receive all the logs in a JSON /any other structured format or do we need to use the string parsing?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…