diff --git a/src/backend/doc/README.md b/src/backend/doc/README.md index 0f0bfb005..12280e773 100644 --- a/src/backend/doc/README.md +++ b/src/backend/doc/README.md @@ -16,3 +16,4 @@ Steve Ballmer impression so it's definitely worth it. - [Boot Sequence](./contributors/boot-sequence.md) - [Kernel](./Kernel.md) - [Modules](./contributors/modules.md) +- [Configuring Logs](./log_config.md) diff --git a/src/backend/src/filesystem/batch/BatchExecutor.js b/src/backend/src/filesystem/batch/BatchExecutor.js index 15b137b06..605145a23 100644 --- a/src/backend/src/filesystem/batch/BatchExecutor.js +++ b/src/backend/src/filesystem/batch/BatchExecutor.js @@ -44,6 +44,8 @@ class BatchExecutor extends AdvancedBase { this.concurrent_ops = 0; this.max_concurrent_ops = 20; this.ops_promise = null; + + this.log_batchCommands = (config.logging ?? []).includes('batch-commands'); } async ready_for_more () { @@ -66,7 +68,9 @@ class BatchExecutor extends AdvancedBase { const { expectations } = this; const command_cls = commands[op.op]; - console.log(command_cls, JSON.stringify(op, null, 2)); + if ( this.log_batchCommands ) { + console.log(command_cls, JSON.stringify(op, null, 2)); + } delete op.op; const workUnit = WorkUnit.create(); diff --git a/src/backend/src/modules/core/lib/expect.js b/src/backend/src/modules/core/lib/expect.js index bb01881fe..8bf9cd6e8 100644 --- a/src/backend/src/modules/core/lib/expect.js +++ b/src/backend/src/modules/core/lib/expect.js @@ -19,6 +19,7 @@ // METADATA // {"def":"core.expect"} const { v4: uuidv4 } = require('uuid'); +const global_config = require('../../../config'); /** * @class WorkUnit @@ -51,7 +52,9 @@ class WorkUnit { this.checkpoint_ = null; } checkpoint (label) { - console.log('CHECKPOINT', label); + if ( ( global_config.logging ?? [] ).includes('checkpoint') ) { + console.log('CHECKPOINT', label); + } this.checkpoint_ = label; } }