Skip to content

Commit

Permalink
fix: remove reliance on config + api path fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MirandaWood committed Jan 23, 2023
1 parent 469990f commit eb6e07a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ zappFilesBoilerplate = () => {
generic: true,
},
{
readPath: 'src/boilerplate/common/api.mjs',
readPath: pathPrefix + '/api.mjs',
writePath: './orchestration/api.mjs',
generic: true,
},
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/visitors/checks/accessedVisitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export default {
// end of error checking
// ------
logger.debug(`Found an accessed secret state ${node.name}`);
if (config.get('log_level') === 'debug') backtrace.getSourceCode(node.src);
if (logger.level === 'debug') backtrace.getSourceCode(node.src);
scope.getReferencedBinding(node)?.updateAccessed(path);
const indicator = scope.getReferencedIndicator(node);
if (indicator instanceof StateVariableIndicator) indicator.updateAccessed(path);
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/visitors/checks/incrementedVisitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default {
expressionNode.isDecremented = isDecremented;

// print if in debug mode
if (config.get('log_level') === 'debug') backtrace.getSourceCode(node.src);
if (logger.level === 'debug') backtrace.getSourceCode(node.src);
logger.debug(`statement is incremented? ${isIncremented}`);
if (isIncremented && !isDecremented) {
const incs = [];
Expand Down
2 changes: 1 addition & 1 deletion src/traverse/Binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ export class VariableBinding extends Binding {
logger.debug(
`Found a statement which burns the secret state and allows it to be reinitialised. If this line isn't meant to do that, check why you are setting the address to 0.`,
);
if (config.get('log_level') === 'debug') backtrace.getSourceCode(node.src);
if (logger.level === 'debug') backtrace.getSourceCode(node.src);
this.isBurned = true;
// TODO more useful indicators here
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function formatWithInspect(val: any) {
}

export default createLogger({
level: config.get('log_level') || 'info', // can be also edited using CLI option --log-level
level: config.has('log_level') ? config.get('log_level') : 'info', // can be also edited using CLI option --log-level
format: winston.format.combine(
format.errors({ stack: true }),
format.colorize(),
Expand Down

0 comments on commit eb6e07a

Please sign in to comment.