REF: logging

This commit is contained in:
overtorment 2024-07-10 19:46:36 +01:00
parent e307f65e45
commit aab883a65c
5 changed files with 9 additions and 9 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "groundcontrol",
"version": "2.3.0",
"version": "2.3.1",
"lockfileVersion": 2,
"requires": true,
"packages": {

View File

@ -1,6 +1,6 @@
{
"name": "groundcontrol",
"version": "2.3.0",
"version": "2.3.1",
"description": "GroundControl push server API",
"devDependencies": {
"@types/node": "18.7.16",

View File

@ -60,7 +60,7 @@ async function processBlock(blockNum, sendQueueRepository: Repository<SendQueue>
}
}
console.warn(addresses.length, "addresses paid in block");
console.log(addresses.length, "addresses paid in block");
// allPotentialPushPayloadsArray.push({ address: "bc1qaemfnglf928kd9ma2jzdypk333au6ctu7h7led", txid: "666", sat: 1488, type: 2, token: "", os: "ios" }); // debug fixme
// addresses.push("bc1qaemfnglf928kd9ma2jzdypk333au6ctu7h7led"); // debug fixme

View File

@ -125,7 +125,7 @@ dataSource
try {
await processMempool();
} catch (error) {
console.log(error);
console.warn('Exception in processMempool():', error);
}
const end = +new Date();
process.env.VERBOSE && console.log("processing mempool took", (end - start) / 1000, "sec");

View File

@ -91,31 +91,31 @@ dataSource
switch (payload.type) {
case 2:
payload = <components["schemas"]["PushNotificationOnchainAddressGotPaid"]>payload;
process.env.VERBOSE && console.warn("pushing to token", payload.token, payload.os);
process.env.VERBOSE && console.log("pushing to token", payload.token, payload.os);
await GroundControlToMajorTom.pushOnchainAddressWasPaid(connection, GroundControlToMajorTom.getGoogleServerKey(), GroundControlToMajorTom.getApnsJwtToken(), payload);
await sendQueueRepository.remove(record);
break;
case 3:
payload = <components["schemas"]["PushNotificationOnchainAddressGotUnconfirmedTransaction"]>payload;
process.env.VERBOSE && console.warn("pushing to token", payload.token, payload.os);
process.env.VERBOSE && console.log("pushing to token", payload.token, payload.os);
await GroundControlToMajorTom.pushOnchainAddressGotUnconfirmedTransaction(connection, GroundControlToMajorTom.getGoogleServerKey(), GroundControlToMajorTom.getApnsJwtToken(), payload);
await sendQueueRepository.remove(record);
break;
case 1:
payload = <components["schemas"]["PushNotificationLightningInvoicePaid"]>payload;
process.env.VERBOSE && console.warn("pushing to token", payload.token, payload.os);
process.env.VERBOSE && console.log("pushing to token", payload.token, payload.os);
await GroundControlToMajorTom.pushLightningInvoicePaid(connection, GroundControlToMajorTom.getGoogleServerKey(), GroundControlToMajorTom.getApnsJwtToken(), payload);
await sendQueueRepository.remove(record);
break;
case 4:
payload = <components["schemas"]["PushNotificationTxidGotConfirmed"]>payload;
process.env.VERBOSE && console.warn("pushing to token", payload.token, payload.os);
process.env.VERBOSE && console.log("pushing to token", payload.token, payload.os);
await GroundControlToMajorTom.pushOnchainTxidGotConfirmed(connection, GroundControlToMajorTom.getGoogleServerKey(), GroundControlToMajorTom.getApnsJwtToken(), payload);
await sendQueueRepository.remove(record);
break;
case 5:
payload = <components["schemas"]["PushNotificationMessage"]>payload;
process.env.VERBOSE && console.warn("pushing to token", payload.token, payload.os);
process.env.VERBOSE && console.log("pushing to token", payload.token, payload.os);
await GroundControlToMajorTom.pushMessage(connection, GroundControlToMajorTom.getGoogleServerKey(), GroundControlToMajorTom.getApnsJwtToken(), payload);
await sendQueueRepository.remove(record);
break;