client.logging: do lazy json formatting - only if logging is enabled