Skip to content

Commit 0830d02

Browse files
committed
🔊 Add more logs
1 parent 009a8e3 commit 0830d02

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/models/controller.model.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,12 +1331,17 @@ export class Controller {
13311331
if (!providerConfig) {
13321332
throw new ServerError(400, 'Missing parameters');
13331333
}
1334+
13341335
if (!this.adapter.getAccountId) {
13351336
throw new ServerError(501, 'Fetching account id is not implemented');
13361337
}
1338+
1339+
infoLogger('getAccountId', 'START', providerConfig.apiKey);
1340+
13371341
try {
13381342
const accountId = await this.adapter.getAccountId(providerConfig);
1339-
console.log('accountId', accountId);
1343+
1344+
infoLogger('getAccountId', 'END', providerConfig.apiKey);
13401345
res.status(200).send(accountId.toString());
13411346
} catch (error: any) {
13421347
errorLogger(
@@ -1363,13 +1368,21 @@ export class Controller {
13631368
throw new ServerError(403, 'Webhook verification failed');
13641369
}
13651370

1371+
infoLogger('handleWebhook', 'START', '');
1372+
13661373
try {
13671374
const contactsChangedData: ContactsChangedData =
13681375
await this.adapter.handleWebhook(req);
13691376

1370-
console.log('sending webhook to pubsub', contactsChangedData);
1377+
infoLogger(
1378+
'handleWebhook',
1379+
`Got ${contactsChangedData.data.length} changed contacts`,
1380+
'',
1381+
);
1382+
13711383
this.pubSubContactsChangedClient?.publishMessage(contactsChangedData);
13721384

1385+
infoLogger('handleWebhook', 'END', '');
13731386
res.sendStatus(200);
13741387
} catch (error) {
13751388
errorLogger(

0 commit comments

Comments
 (0)