These annoying messages come from libboringssl.dylib :: boringssl_metrics_log_event:
int boringssl_metrics_log_event(...) {
...
if (g_boringssl_log != nil && os_log_type_enabled(g_boringssl_log, OS_LOG_TYPE_ERROR) {
os_log_error(g_boringssl_log, "%s(%d) Failed to log metrics", "boringssl_metrics_log_metric_block_invoke", 151);
}
...
}
An easy way to silence these messages is to nullify g_boringssl_log.
g_boringssl_log is a global variable:
os_log_t g_boringssl_log = nil;
It gets initialized in boringssl_log_open:
void boringssl_log_open() {
static dispatch_token onceToken = nil;
dispatch_once(onceToken, ^{
g_boringssl_log = os_log_create("com.apple.network", "boringssl");
});
}
IMO the easiest solution to nullify g_boring_ssl is to skip the execution of dispatch_once.
That could be achieved with setting a breakpoint to __boringssl_log_open_block_invoke with action thread return. This breakpoint will be called once thanks to dispatch_once, but the function's body will not be executed because of immediate thread return. So g_boringssl_log will never be initialized, and there will be no logs in the Console.
Post
Replies
Boosts
Views
Activity
Try that:
https://developer.apple.com/forums/thread/79025?answerId=710450022#710450022
https://stackoverflow.com/a/71865625/1837959