5.3 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| quick-11 | 11 | execute | 1 |
|
true |
|
Purpose: During a full library scan, the app emits 3-6+ Debug log lines per audio file to stdout
(queueing, saving, indexing, cover art processing). For a library with thousands of files, this
produces tens of thousands of lines flooding stdout. When neovim's overseer plugin captures the
make dev process output, this overwhelms the terminal buffer, corrupting neovim's display — the
user sees their terminal beneath a partially-rendered neovim window and has to clear and reopen.
The root cause is that dev mode hardcodes slog.LevelDebug with no way to override it. The fix:
- Change dev mode default from Debug to Info (scan progress is already reported via Info-level "beginning library scan" and "library scan complete" messages)
- Add YJ_LOG_LEVEL env var to allow opting into Debug when actually debugging
- Add a convenience
make dev-debugtarget for when verbose logging is needed
Output: Modified main.go with configurable log level, updated Makefile with dev-debug target.
<execution_context> @/home/caleb/.config/opencode/get-shit-done/workflows/execute-plan.md @/home/caleb/.config/opencode/get-shit-done/templates/summary.md </execution_context>
@.planning/STATE.md Task 1: Add configurable log level via YJ_LOG_LEVEL env var main.go In main.go, replace the hardcoded log level logic:Current code (lines 33-38):
var loglevel slog.Level
if isDev {
loglevel = slog.LevelDebug
} else {
loglevel = slog.LevelInfo
}
Replace with env-var-based log level resolution:
loglevel := resolveLogLevel(isDev)
Add a resolveLogLevel function (in main.go, before or after main()):
// resolveLogLevel determines the slog level. In dev mode the default
// is Info (not Debug) to avoid flooding stdout during library scans.
// Set YJ_LOG_LEVEL=debug to restore verbose logging.
//
// Accepted values: debug, info, warn, error (case-insensitive).
// Production builds always default to Info.
func resolveLogLevel(isDev bool) slog.Level {
if env := os.Getenv("YJ_LOG_LEVEL"); env != "" {
switch strings.ToLower(env) {
case "debug":
return slog.LevelDebug
case "info":
return slog.LevelInfo
case "warn":
return slog.LevelWarn
case "error":
return slog.LevelError
}
}
// Default: Info for both dev and prod.
return slog.LevelInfo
}
Add "strings" to the import block if not already present.
This changes dev default from Debug to Info. The ~14 Debug log lines per audio file during scan will no longer appear, dramatically reducing stdout volume. Info-level messages like "beginning library scan", "library scan complete", and "library data cleared successfully" still appear so the user knows what's happening. go build -tags webkit2_41 ./... compiles without errors
- Dev mode defaults to Info-level logging (not Debug)
- YJ_LOG_LEVEL=debug restores verbose logging
- YJ_LOG_LEVEL accepts debug/info/warn/error (case-insensitive)
- No debug log flood during library scan at default level
dev-debug: setup generate clean
WEBKIT_DISABLE_DMABUF_RENDERER=1 YJ_LOG_LEVEL=debug go tool wails dev -tags webkit2_41 -loglevel Debug -v 2
This gives a one-command way to get the old verbose behavior when actually debugging.
The existing dev target stays unchanged (it now runs quieter because the Go app defaults to Info).
make -n dev-debug shows the correct command with YJ_LOG_LEVEL=debug
make dev-debugtarget exists and sets YJ_LOG_LEVEL=debugmake devcontinues to work unchanged (but quieter due to Task 1)
<success_criteria>
- Dev mode no longer floods stdout with Debug-level per-file scan logs
- User can opt into Debug logging via YJ_LOG_LEVEL=debug or
make dev-debug - No behavioral changes to the application itself (only log verbosity) </success_criteria>