Skip to content

Commit 8d2759c

Browse files
committed
Remove some logs again
1 parent 0298e6d commit 8d2759c

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

library/agent/Agent.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,7 @@ t.test("it logs when failed to report event", async () => {
667667
"Starting agent...",
668668
"Found token, reporting enabled!",
669669
"Heartbeat...",
670+
"Failed to do heartbeat",
670671
]);
671672
});
672673

library/agent/Agent.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,11 @@ export class Agent {
208208
this.attackLogger.log(attack);
209209

210210
if (this.token) {
211-
this.api
212-
.report(this.token, attack, this.timeoutInMS)
213-
.then((response) => this.checkForReportingAPIError(response))
214-
.catch((err) => {
215-
console.error(
216-
`Aikido: Failed to report attack event to Aikido platform: ${err.message}`
217-
);
218-
});
211+
this.api.report(this.token, attack, this.timeoutInMS).catch((err) => {
212+
console.error(
213+
`Aikido: Failed to report attack event to Aikido platform: ${err.message}`
214+
);
215+
});
219216
}
220217
}
221218

@@ -224,9 +221,7 @@ export class Agent {
224221
*/
225222
private heartbeat(timeoutInMS = this.timeoutInMS) {
226223
this.sendHeartbeat(timeoutInMS).catch((err) => {
227-
console.error(
228-
`Aikido: Failed to send heartbeat event to Aikido platform: ${err.message}`
229-
);
224+
this.logger.log("Failed to do heartbeat");
230225
});
231226
}
232227

@@ -313,7 +308,6 @@ export class Agent {
313308
timeoutInMS
314309
);
315310

316-
this.checkForReportingAPIError(response);
317311
this.updateServiceConfig(response);
318312
}
319313
}

0 commit comments

Comments
 (0)