MOZ_LOG_*DEBUG_ONLY() and pretty printers of bool

52 views
Skip to first unread message

Masayuki Nakano

unread,
Aug 22, 2025, 2:59:47 AMAug 22
to dev-pl...@mozilla.org

For the performance sensitive paths or privacy concerns, you may want to enable `MOZ_LOG` only in debug builds. In this case, you can now use:

  • MOZ_LOG_DEBUG_ONLY(...)
  • MOZ_LOG_DURATION_DEBUG_ONLY(...)
  • MOZ_LOG_FMT_DEBUG_ONLY(...)

These macros put corresponding macro only when `#ifdef DEBUG`.

Additionally, new bool pretty printers are shipped together.

They are defined with new `MOZ_DEFINE_BOOL_PRETTY_PRINTER()` macro. Therefore, if you want another version of bool pretty printer, you can define it in proper scope like this.

-- 
Masayuki Nakano <masa...@d-toybox.com>
Working on DOM, Events, editor and IME handling for Gecko
Reply all
Reply to author
Forward
0 new messages