Optimize expensive logging calls.