Skip to content

Commit

Permalink
7143: Enable debug logs in BB whenever the TS has debug log enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmon committed Jun 25, 2024
1 parent dc2954a commit 953a1d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion yarn-project/bb-prover/src/bb/execute.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type AvmCircuitInputs } from '@aztec/circuits.js';
import { sha256 } from '@aztec/foundation/crypto';
import { type LogFn } from '@aztec/foundation/log';
import { type LogFn, currentLevel as currentLogLevel } from '@aztec/foundation/log';
import { Timer } from '@aztec/foundation/timer';
import { type NoirCompiledCircuit } from '@aztec/types/noir';

Expand Down Expand Up @@ -335,6 +335,7 @@ export async function generateAvmProof(
avmHintsPath,
'-o',
outputPath,
currentLogLevel == 'debug' ? '-d' : 'verbose' ? '-v' : '',
];
const timer = new Timer();
const logFunction = (message: string) => {
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/foundation/src/log/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const DefaultLogLevel = process.env.NODE_ENV === 'test' ? ('silent' as const) :
export type LogLevel = (typeof LogLevels)[number];

const envLogLevel = process.env.LOG_LEVEL?.toLowerCase() as LogLevel;
const currentLevel = LogLevels.includes(envLogLevel) ? envLogLevel : DefaultLogLevel;
export const currentLevel = LogLevels.includes(envLogLevel) ? envLogLevel : DefaultLogLevel;

const namespaces = process.env.DEBUG ?? 'aztec:*';
debug.enable(namespaces);
Expand Down

0 comments on commit 953a1d2

Please sign in to comment.