only log debug if settings.debug is true in distributed queries