You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(host): compile out log_debug in release (NDEBUG) builds (#431)
* fix(host): compile out log_debug in release (NDEBUG) builds
`log_debug`'s per-addon diagnostic chatter (library found/loaded, symbol
resolution, ...) was firing unconditionally on every addon load, including in
shipped release builds - unwanted logcat/os_log output plus string-formatting
cost on a startup path.
log_debug is now an inline no-op declared in Logger.hpp when NDEBUG is
defined (set by CMake's Release/MinSizeRel/RelWithDebInfo configurations, and
by Xcode's Release configuration by default), mirroring React Native's own
dev/release logging split. Logger.cpp's real definition is compiled only
outside of NDEBUG. log_warning/log_error are untouched and keep firing in
every build type, including RelWithDebInfo.
This is compile-time only, not the "compile-time default with runtime
override" the issue floats as the ideal: there's no existing runtime config
plumbing (env var, JS-settable flag, ...) in this codebase to hook an
override into, so adding one would mean inventing new plumbing rather than
reusing something established. Shipping the safer compile-time-only guard now
per the issue's own fallback.
Closes#420
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DaK9eAAF5G8wj6UT8VekAm
* docs: keep inline comments brief, trim the Logger ones
Adds a `.claude/CLAUDE.md` section: default to no inline comment, and keep
the ones that survive to a line or two. Rationale, rejected alternatives and
change narration go in the PR description, which is where a `git blame` leads
anyway and which does not go stale as the surrounding code moves.
Applies it to the log_debug/NDEBUG comments this PR added.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NmbKZsRagnasxGVXtnCLoF
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments