β¨ | Drupal core | Enable users to determine which types of log messages get written to dblog/syslog. Right now it's all or nothing.
πΊπΈUnited States Dave Cohen
As you know, drupal_alter() has benefits to offset that cost. It's been added to more than a few functions that can be fired quite often. Like url(), menu_get_item(), etc. IMHO it's worth the cost for (a) the added flexibility, and (b) the small patch that could actually make it into D7.
I haven't actually tested the performance impact it would have on watchdog(). But watchdog() already invokes hook_watchdog(), so I'm guessing the change would be from kinda slow to kinda slower, not from fast to slow.
β¨ | Drupal core | Enable users to determine which types of log messages get written to dblog/syslog. Right now it's all or nothing.
πΊπΈUnited States Dave Cohen
I agree with @breathingrock that using drupal_alter() is a nice approach and deserves to be in D7 and D8. Thanks for that patch.