This avoids the need for potentially expensive block_in_place(), but is unlikely to actually block the thread as holding write lock is rare.
Move DebugLogging into debug logging module. Remove Context.send_log_event(). Use blocking_read() instead of try_read() to get read lock on debug_logging() in synchronous code. Do not try to log events while holding a lock on DebugLogging.
This feature has been stable since Rust 1.58.0.
debug logging