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

Commit

Permalink
Ignore MythX log "info" log-level messages ...
Browse files Browse the repository at this point in the history
unless "debug" is set.
  • Loading branch information
rocky committed Mar 15, 2019
1 parent 1a4f627 commit c28542a
Show file tree
Hide file tree
Showing 2 changed files with 1,549 additions and 1,386 deletions.
19 changes: 16 additions & 3 deletions helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,24 @@ function doReport(config, objects, errors, notAnalyzedContracts) {
}

const logs = objects.map(obj => obj.logs)
.reduce((acc, curr) => acc.concat(curr), []);
if (logs.length > 0) {
.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 (!config.debug && log.level !== 'info') {
haveLog = true;
break;
}
}

if (haveLogs) {
config.logger.log('MythX Logs:'.yellow);
logs.forEach(log => {
config.logger.log(`${log.level}: ${log.msg}`);
if (!config.debug && log.level !== 'info') {
config.logger.log(`${log.level}: ${log.msg}`);
}
});
}

Expand Down
Loading

0 comments on commit c28542a

Please sign in to comment.