Skip to content

CLI: log warnings to stderr by default - #1651

Open
MatejKozlovsky wants to merge 1 commit into
storytold:mainfrom
MatejKozlovsky:cli-warn-logging
Open

MatejKozlovsky wants to merge 1 commit into
storytold:mainfrom
MatejKozlovsky:cli-warn-logging

Conversation

@MatejKozlovsky

Copy link
Copy Markdown
Contributor

The CLI never installed a logger, so log::warn! from the GPU path (a frame the GPU declines, device out of memory, falling back to the CPU) went nowhere and an export could quietly render on the CPU with no hint why.

This installs the engine logger in the CLI with a warn default; RUST_LOG still overrides it. The app keeps its current default (warn,effectcraft=info) through logging::install(), which now just calls the new install_with(DEFAULT_FILTER).

Split out of #1415 as suggested; no other changes from that PR.

Tested: fmt, clippy -D warnings (cli + engine), cargo test -p effectcraft-cli, engine logging tests, on Linux, llvmpipe.

Note: a failed render now shows the error twice on stderr, the engine's WARN line from the render queue (with the item id) plus the CLI's own error.

Possible follow-up: also print the chosen adapter/backend at warn (or behind -v) so CLI users see which GPU, if any, they got.

The CLI installed no logger, so GPU warnings (a declined frame, out of
memory, fallback to the CPU) were dropped and an export silently rendered
on the CPU. Install the engine logger with a `warn` default (RUST_LOG
still overrides). Split out of storytold#1415.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant