reduce unecessary memory allocation

Avoid calls to logQueryArgs when logger is a discardLogger