bnjbvr opened PR #4484 from log-macros
to main
:
- First commit introduces a Cargo feature (disabled by default) to enable/disable trace logs in cranelift-codegen, as well as a macro that will call into
log::trace
only if the feature is enabled, following exactly what regalloc2 does. If downstream users set theirlog::max_level
toTrace
, they would pay the cost for the logging infrastructure, even if the logger eventually decides to throw away the logs' contents, so it's better overall to not call into the logging infra at all.- Second commit: previously disassembly was emitted if explicitly enabled (only in testing setups), or when the log level was debug or more. I suppose this was done during hacking on regalloc2 (as the commit introducing this change is the switch to regalloc2), and never reverted, so I've done that here. We could add a cranelift flag to be able to request that at runtime with the CLI, if needs be.
With this change and those from other PRs, there's no more meaningful difference between a Wasmtime embedding setting the log's max level to trace or above.
bnjbvr updated PR #4484 from log-macros
to main
.
bnjbvr requested cfallin for a review on PR #4484.
cfallin submitted PR review.
bnjbvr updated PR #4484 from log-macros
to main
.
bnjbvr merged PR #4484.
Last updated: Dec 23 2024 at 12:05 UTC