How to log events in functions?
Logger.info('EVENT_DESCRIPTION', {
message,
userId,
});How should you log events?
const Logger = require('firebase-functions/lib/logger');
const confirmPayment = async ({ customerId, amount }) => {
// payment logic
await stripe.charge({
customer: customerId,
amount,
});
Logger.info('CUSTOMER_CHARGED', {
customerId,
amount,
});
}
module.exports = confirmPayment;How should I log errors?
Last updated