feat(common): centralized debug module for DAW projects #96

Closed
opened 2026-05-28 06:23:35 +02:00 by michael · 1 comment
Owner

Goal

Introduce a centralized debug module for DAW projects that replaces
ad-hoc --debug flag handling with a unified API.

Requirements

  • Enable/disable via --debug flag or environment variable DAW_DEBUG
  • Structured output: [DEBUG] module:function -- message
  • Per-module enable/disable (e.g. DAW_DEBUG=runner,loader)
  • No output in production unless explicitly enabled
  • Available in every DAW program via single require

Open questions

  • Relation to logging module (same module or separate?)
  • Debug output target: stderr only, or configurable?
  • How to pass debug state through call chain without threading it everywhere?
  • Integration with fragjan --debug flag (DAW/fragjan#87)

See also

  • DAW/fragjan#87 (--debug flag in fragjan)
  • daw.common logging issue (companion to this)
## Goal Introduce a centralized debug module for DAW projects that replaces ad-hoc --debug flag handling with a unified API. ## Requirements - Enable/disable via --debug flag or environment variable DAW_DEBUG - Structured output: [DEBUG] module:function -- message - Per-module enable/disable (e.g. DAW_DEBUG=runner,loader) - No output in production unless explicitly enabled - Available in every DAW program via single require ## Open questions - Relation to logging module (same module or separate?) - Debug output target: stderr only, or configurable? - How to pass debug state through call chain without threading it everywhere? - Integration with fragjan --debug flag (DAW/fragjan#87) ## See also - DAW/fragjan#87 (--debug flag in fragjan) - daw.common logging issue (companion to this)
michael added this to the Basic Version milestone 2026-05-30 16:08:42 +02:00
Author
Owner

Decision: no separate debug module

DEBUG is a level in daw.common.log -- no separate module needed.

The open questions from this issue are resolved as follows:

Relation to logging module: DEBUG is a level (DEBUG/INFO/WARN/ERROR/FAULT),
not a separate module. daw.common.log handles all levels uniformly.

Debug output target: Configured via [logging.debug] in fragjan.conf.
Separate log file recommended -- debug volume is too high for UI output.

How to pass debug state through call chain: Via ctx. The --debug flag
sets a value in ctx at startup. No global, no singleton.

Integration with --debug flag: --debug activates the DEBUG level in
adapters/log. Entries below the configured level are filtered per target.

Closing in favor of DAW/fragjan#95 (daw.common.log) and DAW/fragjan#97 (adapters/log).
See also: DAW/fragjan#117 (daw.log.file module).

## Decision: no separate debug module DEBUG is a level in daw.common.log -- no separate module needed. The open questions from this issue are resolved as follows: **Relation to logging module:** DEBUG is a level (DEBUG/INFO/WARN/ERROR/FAULT), not a separate module. daw.common.log handles all levels uniformly. **Debug output target:** Configured via [logging.debug] in fragjan.conf. Separate log file recommended -- debug volume is too high for UI output. **How to pass debug state through call chain:** Via ctx. The --debug flag sets a value in ctx at startup. No global, no singleton. **Integration with --debug flag:** --debug activates the DEBUG level in adapters/log. Entries below the configured level are filtered per target. Closing in favor of DAW/fragjan#95 (daw.common.log) and DAW/fragjan#97 (adapters/log). See also: DAW/fragjan#117 (daw.log.file module).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DAW/fragjan#96
No description provided.