@@ -574,15 +574,12 @@ public function fetch()
574574 $ searchResult = $ this ->evaluateResult ($ this ->result );
575575
576576 $ this ->result ['nodes ' ] = [];
577- if ($ this ->logThisQuery === true ) {
578- $ this ->logger ->log (sprintf ('Query Log (%s): %s -- execution time: %s ms -- Limit: %s -- Number of results returned: %s -- Total Results: %s ' ,
579- $ this ->logMessage , $ request , (($ timeAfterwards - $ timeBefore ) * 1000 ), $ this ->limit , count ($ searchResult ->getHits ()), $ searchResult ->getTotal ()), LOG_DEBUG );
580- }
577+
578+ $ this ->logThisQuery && $ this ->logger ->log (sprintf ('Query Log (%s): %s -- execution time: %s ms -- Limit: %s -- Number of results returned: %s -- Total Results: %s ' , $ this ->logMessage , $ request , (($ timeAfterwards - $ timeBefore ) * 1000 ), $ this ->limit , count ($ searchResult ->getHits ()), $ searchResult ->getTotal ()), LOG_DEBUG );
581579
582580 if (count ($ searchResult ->getHits ()) > 0 ) {
583581 $ this ->result ['nodes ' ] = $ this ->convertHitsToNodes ($ searchResult ->getHits ());
584582 }
585-
586583 } catch (ApiException $ exception ) {
587584 $ this ->logger ->logException ($ exception );
588585 $ this ->result ['nodes ' ] = [];
@@ -635,9 +632,7 @@ public function count()
635632 $ treatedContent = $ response ->getTreatedContent ();
636633 $ count = $ treatedContent ['count ' ];
637634
638- if ($ this ->logThisQuery === true ) {
639- $ this ->logger ->log ('Count Query Log ( ' . $ this ->logMessage . '): ' . $ request . ' -- execution time: ' . (($ timeAfterwards - $ timeBefore ) * 1000 ) . ' ms -- Total Results: ' . $ count , LOG_DEBUG );
640- }
635+ $ this ->logThisQuery && $ this ->logger ->log ('Count Query Log ( ' . $ this ->logMessage . '): ' . $ request . ' -- execution time: ' . (($ timeAfterwards - $ timeBefore ) * 1000 ) . ' ms -- Total Results: ' . $ count , LOG_DEBUG );
641636
642637 return $ count ;
643638 }
@@ -780,9 +775,7 @@ protected function convertHitsToNodes(array $hits): array
780775 }
781776 }
782777
783- if ($ this ->logThisQuery === true ) {
784- $ this ->logger ->log ('Returned nodes ( ' . $ this ->logMessage . '): ' . count ($ nodes ), LOG_DEBUG );
785- }
778+ $ this ->logThisQuery && $ this ->logger ->log ('Returned nodes ( ' . $ this ->logMessage . '): ' . count ($ nodes ), LOG_DEBUG );
786779
787780 $ this ->elasticSearchHitsIndexedByNodeFromLastRequest = $ elasticSearchHitPerNode ;
788781
0 commit comments