public void endTrace(QueryObserver indexObserver, long startTime, Object result) {
    if (traceOn && cache != null) {
      int resultSize = -1;

      if (result instanceof Collection) {
        resultSize = ((Collection) result).size();
      }

      String queryVerboseMsg =
          DefaultQuery.getLogMessage(indexObserver, startTime, resultSize, queryString);
      logger.info(queryVerboseMsg);
    }
  }
For queries which are executed from a Function "with a Filter".

@return returns if this query is coming from a {@link Function}.
geode-core/src/main/java/org/apache/geode/cache/query/internal/DefaultQuery.java