Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
Once more update logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Mar 16, 2019
1 parent 4d38f38 commit 5b7f79f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions helpers.js
Expand Up @@ -358,8 +358,11 @@ const doAnalysis = async (client, config, contracts, contractNames = null, limit

function doReport(config, objects, errors, notAnalyzedContracts) {

// Return true if we shold show log.
// Ignore logs with log.level "info" unless the "debug" flag
// has been set.
function showLog(log) {
return config.log || log.level !== 'info'
return config.debug || (log.level !== 'info');
}

if (config.yaml) {
Expand Down Expand Up @@ -388,12 +391,10 @@ function doReport(config, objects, errors, notAnalyzedContracts) {
const logs = objects.map(obj => obj.logs)
.reduce((acc, curr) => acc.concat(curr), []);

// Ignore logs with log.level "info" unless the "debug" flag
// has been set.
let haveLogs = false;
for(const log of logs) {
if (showLog(log)) {
haveLog = true;
haveLogs = true;
break;
}
}
Expand Down

0 comments on commit 5b7f79f

Please sign in to comment.