I have a couple of functions on my cloud functions, but I can only see the out put of one logger from the very first function
``Moralis.Cloud.afterSave(âSongListedâ, async (request) => {
const confirmed = request.object.get(âconfirmedâ);
const logger = Moralis.Cloud.getLogger();
logger.info(âlooking for the confirmed txâŚâ);
//checking if thre item has beeen confirmed/listed
if (confirmed) {
logger.info(âFound itemâŚâ);
//checking if ActiveItem existed and if not, create it
const ActiveItem = Moralis.Object.extend(âActiveItemâ);
const query = Moralis.Cloud.Query("ActiveItem");
query.equalTo("marketplaceAddress", request.object.get("address"));
query.equalTo("nftAddress", request.object.get("nftAddress"));
query.equalTo("tokenId", request.object.get("tokenId"));
query.equalTo("seller", request.object.get("seller"));
const alreadyListed = await query.first();
if (alreadyListed) {
logger.info(`Deleting already listed ${request.object.get("objectID")}`);
await alreadyListed.destroy();
logger.info(
`Deleted item already Listed with token id ${request.object.get(
"tokenId"
)} at address${request.object.get("address")} since its already listed`
);
}
const activeItem = new ActiveItem();
activeItem.set("marketplaceAddress", request.object.get("address"));
activeItem.set("nftAddress", request.object.get("nftAddress"));
activeItem.set("price", request.object.get("price"));
activeItem.set("tokenId", request.object.get("tokenId"));
activeItem.set("seller", request.object.get("seller"));
logger.info(
`Adding Address ${request.object.get(
"address"
)}. TokenID:${request.object.get("tokenId")}}`
);
logger.info("saving...");
await activeItem.save();
}
});
Moralis.Cloud.afterSave(âItemCanceledâ, async (request) => {
//getting the confirm status from the moralis serveer
const confirmed = request.object.get(âconfirmedâ);
const logger = Moralis.Cloud.getLogger();
logger.info(âHello loggerâ);
logger.info(MarketPlace | Object ${request.object}
);
//checking for the confirmation status
if (confirmed) {
//getting the moralis active Item table
const ActiveItem = Moralis.Object.extend(âActiveItemâ);
const query = new Moralis.Query(ActiveItem);
// getting the table data
query.equalTo("marketplaceAddress", request.object.get("address"));
query.equalTo("nftAddress", request.object.get("nftAddress"));
query.equalTo("tokenId", request.object.get("tokenId"));
logger.info(`MarketPlace | Query:${query}`);
// getting the first item that matches the search query
const canceledItem = await query.first();
logger.info(`MarketPlace | CanceledItem: ${canceledItem}`);
if (canceledItem) {
logger.info(
`Deleting ${request.object.get(
"tokenId"
)} at address${request.object.get("address")} since it was canceled`
);
await canceledItem.destroy();
} else {
logger.info(
`No item was found with address ${request.object.get(
"address"
)} and tokenId:${request.object.get("tokenId")}`
);
}
}
});``
bought functions work, but the logger function on the ItemCanceled isnt working