Skip to content

Commit

Permalink
Adding more debug logs (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
danitseitlin authored Mar 25, 2021
1 parent be64a29 commit c1ebc5e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,17 @@ exports['default'] = () => {
},
async captureLogs(testId, level, message, time, attachment) {
try {
if(this.client.displayDebugLogs)
process.stdout.write(`\n [Test ${testId}] Capturing log: ${message} \n`)
if(!this.reporter.liveReporting)
process.logs.push({ type: level, log: message, file: attachment, time: new Date().valueOf() });
else
await this.reportLogs(testId, level, message, time, attachment);
return message
}
catch (error) {
if(this.client.displayDebugLogs)
process.stdout.write(`\n [Test ${testId}] Sending log: ${message} \n caused error: ${error} \n`)
this.reporter.client.handleError(error);
}
},
Expand Down

0 comments on commit c1ebc5e

Please sign in to comment.