fix: Logger is undefined when unused fields present

This commit is contained in:
emizzle 2020-03-16 18:24:36 +11:00
parent 7e9d7a1eae
commit 60473d1ba9
No known key found for this signature in database
GPG Key ID: 1FD4BAB3C37EE9BA
2 changed files with 2 additions and 2 deletions

View File

@ -162,7 +162,7 @@ const cleanAnalyzeDataEmptyProps = (data, debug, logger) => {
}
if (debug && unusedFields.length > 0) {
logger(`${props.contractName}: Empty JSON data fields from compilation - ${unusedFields.join(', ')}`);
logger.debug(`${props.contractName}: Empty JSON data fields from compilation - ${unusedFields.join(', ')}`);
}
return result;

View File

@ -115,7 +115,7 @@ const doAnalysis = async (armletClient, config, contracts, contractNames = null,
initialDelay
};
analyzeOpts.data = mythXUtil.cleanAnalyzeDataEmptyProps(obj.buildObj, config.debug, config.logger.debug);
analyzeOpts.data = mythXUtil.cleanAnalyzeDataEmptyProps(obj.buildObj, config.debug, config.logger);
analyzeOpts.data.analysisMode = config.full ? "full" : "quick";
if (config.debug > 1) {
config.logger.debug("analyzeOpts: " + `${util.inspect(analyzeOpts, {depth: null})}`);