From 8a5755c8f18438a06e3a83b40b56bd9633ef970c Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 2 Jul 2025 19:34:05 +0200 Subject: [PATCH] Add debug information. --- app/Helpers/Collector/GroupCollector.php | 1 + app/Support/Search/OperatorQuerySearch.php | 274 ++++++++++++--------- 2 files changed, 165 insertions(+), 110 deletions(-) diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php index 4089a5e1bc..3112fcfdfa 100644 --- a/app/Helpers/Collector/GroupCollector.php +++ b/app/Helpers/Collector/GroupCollector.php @@ -434,6 +434,7 @@ class GroupCollector implements GroupCollectorInterface public function findNothing(): GroupCollectorInterface { + Log::warning('The search engine was instructed to FIND NOTHING. This may be a bug.'); $this->query->where('transaction_groups.id', -1); return $this; diff --git a/app/Support/Search/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.php index 095162de47..29604c81a5 100644 --- a/app/Support/Search/OperatorQuerySearch.php +++ b/app/Support/Search/OperatorQuerySearch.php @@ -48,6 +48,7 @@ use FireflyIII\Support\Search\QueryParser\StringNode; use FireflyIII\User; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Log; use LogicException; use TypeError; @@ -84,7 +85,7 @@ class OperatorQuerySearch implements SearchInterface */ public function __construct() { - app('log')->debug('Constructed OperatorQuerySearch'); + Log::debug('Constructed OperatorQuerySearch'); $this->operators = new Collection(); $this->page = 1; $this->words = []; @@ -137,22 +138,22 @@ class OperatorQuerySearch implements SearchInterface */ public function parseQuery(string $query): void { - app('log')->debug(sprintf('Now in parseQuery("%s")', $query)); + Log::debug(sprintf('Now in parseQuery("%s")', $query)); /** @var QueryParserInterface $parser */ $parser = app(QueryParserInterface::class); - app('log')->debug(sprintf('Using %s as implementation for QueryParserInterface', $parser::class)); + Log::debug(sprintf('Using %s as implementation for QueryParserInterface', $parser::class)); try { $parsedQuery = $parser->parse($query); } catch (LogicException|TypeError $e) { - app('log')->error($e->getMessage()); - app('log')->error(sprintf('Could not parse search: "%s".', $query)); + Log::error($e->getMessage()); + Log::error(sprintf('Could not parse search: "%s".', $query)); throw new FireflyException(sprintf('Invalid search value "%s". See the logs.', e($query)), 0, $e); } - app('log')->debug(sprintf('Found %d node(s) at top-level', count($parsedQuery->getNodes()))); + Log::debug(sprintf('Found %d node(s) at top-level', count($parsedQuery->getNodes()))); $this->handleSearchNode($parsedQuery, $parsedQuery->isProhibited(false)); // add missing information @@ -169,7 +170,7 @@ class OperatorQuerySearch implements SearchInterface */ private function handleSearchNode(Node $node, bool $flipProhibitedFlag): void { - app('log')->debug(sprintf('Now in handleSearchNode(%s)', $node::class)); + Log::debug(sprintf('Now in handleSearchNode(%s)', $node::class)); switch (true) { case $node instanceof StringNode: @@ -188,7 +189,7 @@ class OperatorQuerySearch implements SearchInterface break; default: - app('log')->error(sprintf('Cannot handle node %s', $node::class)); + Log::error(sprintf('Cannot handle node %s', $node::class)); throw new FireflyException(sprintf('Firefly III search can\'t handle "%s"-nodes', $node::class)); } @@ -201,11 +202,11 @@ class OperatorQuerySearch implements SearchInterface $prohibited = $node->isProhibited($flipProhibitedFlag); if ($prohibited) { - app('log')->debug(sprintf('Exclude string "%s" from search string', $string)); + Log::debug(sprintf('Exclude string "%s" from search string', $string)); $this->prohibitedWords[] = $string; } if (!$prohibited) { - app('log')->debug(sprintf('Add string "%s" to search string', $string)); + Log::debug(sprintf('Add string "%s" to search string', $string)); $this->words[] = $string; } } @@ -241,11 +242,11 @@ class OperatorQuerySearch implements SearchInterface 'value' => $value, 'prohibited' => $prohibited, ]); - app('log')->debug(sprintf('Added operator type "%s"', $operator)); + Log::debug(sprintf('Added operator type "%s"', $operator)); } } if (!$inArray) { - app('log')->debug(sprintf('Added INVALID operator type "%s"', $operator)); + Log::debug(sprintf('Added INVALID operator type "%s"', $operator)); $this->invalidOperators[] = [ 'type' => $operator, 'value' => $value, @@ -262,24 +263,24 @@ class OperatorQuerySearch implements SearchInterface private function updateCollector(string $operator, string $value, bool $prohibited): bool { if ($prohibited) { - app('log')->debug(sprintf('Operator "%s" is now "%s"', $operator, sprintf('-%s', $operator))); + Log::debug(sprintf('Operator "%s" is now "%s"', $operator, sprintf('-%s', $operator))); $operator = sprintf('-%s', $operator); } - app('log')->debug(sprintf('Now in updateCollector("%s", "%s")', $operator, $value)); + Log::debug(sprintf('Now in updateCollector("%s", "%s")', $operator, $value)); // check if alias, replace if necessary: $operator = self::getRootOperator($operator); switch ($operator) { default: - app('log')->error(sprintf('No such operator: %s', $operator)); + Log::error(sprintf('No such operator: %s', $operator)); throw new FireflyException(sprintf('Unsupported search operator: "%s"', $operator)); // some search operators are ignored, basically: case 'user_action': - app('log')->info(sprintf('Ignore search operator "%s"', $operator)); + Log::info(sprintf('Ignore search operator "%s"', $operator)); return false; @@ -453,6 +454,7 @@ class OperatorQuerySearch implements SearchInterface } if (null === $account) { // since the source does not exist, cannot return results: + Log::warning('Call to findNothing() because source account does not exist (source_account_id).'); $this->collector->findNothing(); } @@ -465,6 +467,7 @@ class OperatorQuerySearch implements SearchInterface } if (null === $account) { // since the source does not exist, cannot return results: + Log::warning('Call to findNothing() because source account does not exist (-source_account_id).'); $this->collector->findNothing(); } @@ -580,6 +583,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->setDestinationAccounts(new Collection([$account])); } if (null === $account) { + Log::warning('Call to findNothing() because dest account does not exist (destination_account_id).'); $this->collector->findNothing(); } @@ -591,24 +595,34 @@ class OperatorQuerySearch implements SearchInterface $this->collector->excludeDestinationAccounts(new Collection([$account])); } if (null === $account) { + Log::warning('Call to findNothing() because dest account does not exist (-destination_account_id).'); $this->collector->findNothing(); } break; case 'account_id': + Log::debug(sprintf('Now in "account_id" with value "%s"', $value)); $parts = explode(',', $value); $collection = new Collection(); foreach ($parts as $accountId) { - $account = $this->accountRepository->find((int) $accountId); + $accountId = (int) $accountId; + Log::debug(sprintf('Searching for account with ID #%d', $accountId)); + $account = $this->accountRepository->find($accountId); if (null !== $account) { + Log::debug(sprintf('Found account with ID #%d ("%s")', $accountId, $account->name)); $collection->push($account); } + if(null === $account) { + Log::debug(sprintf('Did not find account with ID #%d', $accountId)); + } } if ($collection->count() > 0) { + Log::debug(sprintf('Found more than 0 accounts, include the %d found account(s).', $collection->count())); $this->collector->setAccounts($collection); } if (0 === $collection->count()) { + Log::warning('Call to findNothing() because zero accounts found (account_id).'); $this->collector->findNothing(); } @@ -627,6 +641,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->setNotAccounts($collection); } if (0 === $collection->count()) { + Log::warning('Call to findNothing() because zero accounts found (-account_id).'); $this->collector->findNothing(); } @@ -723,6 +738,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->setCurrency($currency); } if (!$currency instanceof TransactionCurrency) { + Log::warning('Call to findNothing() because currency does not exist (currency_is).'); $this->collector->findNothing(); } @@ -734,6 +750,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->excludeCurrency($currency); } if (!$currency instanceof TransactionCurrency) { + Log::warning('Call to findNothing() because currency does not exist (-currency_is).'); $this->collector->findNothing(); } @@ -745,6 +762,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->setForeignCurrency($currency); } if (!$currency instanceof TransactionCurrency) { + Log::warning('Call to findNothing() because currency does not exist (foreign_currency_is).'); $this->collector->findNothing(); } @@ -756,6 +774,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->excludeForeignCurrency($currency); } if (!$currency instanceof TransactionCurrency) { + Log::warning('Call to findNothing() because currency does not exist (-foreign_currency_is).'); $this->collector->findNothing(); } @@ -766,14 +785,14 @@ class OperatorQuerySearch implements SearchInterface // case 'has_attachments': case '-has_no_attachments': - app('log')->debug('Set collector to filter on attachments.'); + Log::debug('Set collector to filter on attachments.'); $this->collector->hasAttachments(); break; case 'has_no_attachments': case '-has_attachments': - app('log')->debug('Set collector to filter on NO attachments.'); + Log::debug('Set collector to filter on NO attachments.'); $this->collector->hasNoAttachments(); break; @@ -799,6 +818,7 @@ class OperatorQuerySearch implements SearchInterface break; } + Log::warning('Call to findNothing() because category does not exist (category_is).'); $this->collector->findNothing(); break; @@ -819,6 +839,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->setCategories($result); } if (0 === $result->count()) { + Log::warning('Call to findNothing() because no category exists (category_ends).'); $this->collector->findNothing(); } @@ -830,6 +851,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->excludeCategories($result); } if (0 === $result->count()) { + Log::warning('Call to findNothing() no category exists (-category_ends).'); $this->collector->findNothing(); } @@ -841,6 +863,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->setCategories($result); } if (0 === $result->count()) { + Log::warning('Call to findNothing() because no category exists (category_starts).'); $this->collector->findNothing(); } @@ -852,6 +875,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->excludeCategories($result); } if (0 === $result->count()) { + Log::warning('Call to findNothing() because no category exists (-category_starts).'); $this->collector->findNothing(); } @@ -863,6 +887,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->setCategories($result); } if (0 === $result->count()) { + Log::warning('Call to findNothing() because no category exists (category_contains).'); $this->collector->findNothing(); } @@ -874,6 +899,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->excludeCategories($result); } if (0 === $result->count()) { + Log::warning('Call to findNothing() because no category exists (-category_contains).'); $this->collector->findNothing(); } @@ -900,6 +926,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->setBudgets($result); } if (0 === $result->count()) { + Log::warning('Call to findNothing() from budget_contains.'); $this->collector->findNothing(); } @@ -911,6 +938,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->excludeBudgets($result); } if (0 === $result->count()) { + Log::warning('Call to findNothing() from -budget_contains.'); $this->collector->findNothing(); } @@ -923,6 +951,7 @@ class OperatorQuerySearch implements SearchInterface break; } + Log::warning('Call to findNothing() from budget_is.'); $this->collector->findNothing(); break; @@ -934,6 +963,7 @@ class OperatorQuerySearch implements SearchInterface break; } + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); break; @@ -944,6 +974,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->setBudgets($result); } if (0 === $result->count()) { + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); } @@ -955,6 +986,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->excludeBudgets($result); } if (0 === $result->count()) { + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); } @@ -966,6 +998,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->setBudgets($result); } if (0 === $result->count()) { + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); } @@ -977,6 +1010,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->excludeBudgets($result); } if (0 === $result->count()) { + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); } @@ -1004,6 +1038,7 @@ class OperatorQuerySearch implements SearchInterface break; } + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); break; @@ -1015,6 +1050,7 @@ class OperatorQuerySearch implements SearchInterface break; } + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); break; @@ -1026,6 +1062,7 @@ class OperatorQuerySearch implements SearchInterface break; } + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); break; @@ -1037,6 +1074,7 @@ class OperatorQuerySearch implements SearchInterface break; } + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); break; @@ -1047,6 +1085,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->setBills($result); } if (0 === $result->count()) { + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); } @@ -1058,6 +1097,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->excludeBills($result); } if (0 === $result->count()) { + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); } @@ -1069,6 +1109,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->setBills($result); } if (0 === $result->count()) { + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); } @@ -1080,6 +1121,7 @@ class OperatorQuerySearch implements SearchInterface $this->collector->excludeBills($result); } if (0 === $result->count()) { + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); } @@ -1109,7 +1151,8 @@ class OperatorQuerySearch implements SearchInterface } // no tags found means search must result in nothing. if (null === $result) { - app('log')->info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator)); + Log::info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator)); + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); } @@ -1118,7 +1161,8 @@ class OperatorQuerySearch implements SearchInterface case 'tag_contains': $tags = $this->tagRepository->searchTag($value); if (0 === $tags->count()) { - app('log')->info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator)); + Log::info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator)); + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); } if ($tags->count() > 0) { @@ -1132,7 +1176,8 @@ class OperatorQuerySearch implements SearchInterface case 'tag_starts': $tags = $this->tagRepository->tagStartsWith($value); if (0 === $tags->count()) { - app('log')->info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator)); + Log::info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator)); + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); } if ($tags->count() > 0) { @@ -1146,7 +1191,8 @@ class OperatorQuerySearch implements SearchInterface case '-tag_starts': $tags = $this->tagRepository->tagStartsWith($value); if (0 === $tags->count()) { - app('log')->info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator)); + Log::info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator)); + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); } if ($tags->count() > 0) { @@ -1159,7 +1205,8 @@ class OperatorQuerySearch implements SearchInterface case 'tag_ends': $tags = $this->tagRepository->tagEndsWith($value); if (0 === $tags->count()) { - app('log')->info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator)); + Log::info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator)); + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); } if ($tags->count() > 0) { @@ -1172,7 +1219,8 @@ class OperatorQuerySearch implements SearchInterface case '-tag_ends': $tags = $this->tagRepository->tagEndsWith($value); if (0 === $tags->count()) { - app('log')->info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator)); + Log::info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator)); + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); } if ($tags->count() > 0) { @@ -1186,7 +1234,8 @@ class OperatorQuerySearch implements SearchInterface $tags = $this->tagRepository->searchTag($value)->keyBy('id'); if (0 === $tags->count()) { - app('log')->info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator)); + Log::info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator)); + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); } if ($tags->count() > 0) { @@ -1276,20 +1325,20 @@ class OperatorQuerySearch implements SearchInterface // case 'amount_is': // strip comma's, make dots. - app('log')->debug(sprintf('Original value "%s"', $value)); + Log::debug(sprintf('Original value "%s"', $value)); $value = str_replace(',', '.', $value); $amount = app('steam')->positive($value); - app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount)); + Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount)); $this->collector->amountIs($amount); break; case '-amount_is': // strip comma's, make dots. - app('log')->debug(sprintf('Original value "%s"', $value)); + Log::debug(sprintf('Original value "%s"', $value)); $value = str_replace(',', '.', $value); $amount = app('steam')->positive($value); - app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount)); + Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount)); $this->collector->amountIsNot($amount); break; @@ -1299,7 +1348,7 @@ class OperatorQuerySearch implements SearchInterface $value = str_replace(',', '.', $value); $amount = app('steam')->positive($value); - app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount)); + Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount)); $this->collector->foreignAmountIs($amount); break; @@ -1309,7 +1358,7 @@ class OperatorQuerySearch implements SearchInterface $value = str_replace(',', '.', $value); $amount = app('steam')->positive($value); - app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount)); + Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount)); $this->collector->foreignAmountIsNot($amount); break; @@ -1320,7 +1369,7 @@ class OperatorQuerySearch implements SearchInterface $value = str_replace(',', '.', $value); $amount = app('steam')->positive($value); - app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount)); + Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount)); $this->collector->amountLess($amount); break; @@ -1331,29 +1380,29 @@ class OperatorQuerySearch implements SearchInterface $value = str_replace(',', '.', $value); $amount = app('steam')->positive($value); - app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount)); + Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount)); $this->collector->foreignAmountLess($amount); break; case '-amount_less': case 'amount_more': - app('log')->debug(sprintf('Now handling operator "%s"', $operator)); + Log::debug(sprintf('Now handling operator "%s"', $operator)); // strip comma's, make dots. $value = str_replace(',', '.', $value); $amount = app('steam')->positive($value); - app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount)); + Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount)); $this->collector->amountMore($amount); break; case '-foreign_amount_less': case 'foreign_amount_more': - app('log')->debug(sprintf('Now handling operator "%s"', $operator)); + Log::debug(sprintf('Now handling operator "%s"', $operator)); // strip comma's, make dots. $value = str_replace(',', '.', $value); $amount = app('steam')->positive($value); - app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount)); + Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount)); $this->collector->foreignAmountMore($amount); break; @@ -1363,13 +1412,13 @@ class OperatorQuerySearch implements SearchInterface // case 'transaction_type': $this->collector->setTypes([ucfirst($value)]); - app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value)); + Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value)); break; case '-transaction_type': $this->collector->excludeTypes([ucfirst($value)]); - app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value)); + Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value)); break; @@ -1525,7 +1574,7 @@ class OperatorQuerySearch implements SearchInterface case 'created_at_on': case '-created_at_on': - app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value)); + Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value)); $range = $this->parseDateRange($operator, $value); $this->setExactObjectDateParams('created_at', $range, $prohibited); @@ -1533,7 +1582,7 @@ class OperatorQuerySearch implements SearchInterface case 'created_at_before': case '-created_at_after': - app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value)); + Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value)); $range = $this->parseDateRange($operator, $value); $this->setObjectDateBeforeParams('created_at', $range); @@ -1541,7 +1590,7 @@ class OperatorQuerySearch implements SearchInterface case 'created_at_after': case '-created_at_before': - app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value)); + Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value)); $range = $this->parseDateRange($operator, $value); $this->setObjectDateAfterParams('created_at', $range); @@ -1549,7 +1598,7 @@ class OperatorQuerySearch implements SearchInterface case 'updated_at_on': case '-updated_at_on': - app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value)); + Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value)); $range = $this->parseDateRange($operator, $value); $this->setExactObjectDateParams('updated_at', $range, $prohibited); @@ -1557,7 +1606,7 @@ class OperatorQuerySearch implements SearchInterface case 'updated_at_before': case '-updated_at_after': - app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value)); + Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value)); $range = $this->parseDateRange($operator, $value); $this->setObjectDateBeforeParams('updated_at', $range); @@ -1565,7 +1614,7 @@ class OperatorQuerySearch implements SearchInterface case 'updated_at_after': case '-updated_at_before': - app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value)); + Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value)); $range = $this->parseDateRange($operator, $value); $this->setObjectDateAfterParams('updated_at', $range); @@ -1817,6 +1866,7 @@ class OperatorQuerySearch implements SearchInterface break; case '-exists': + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); break; @@ -1919,11 +1969,11 @@ class OperatorQuerySearch implements SearchInterface if (str_starts_with($original, '-')) { $return = sprintf('-%s', $config['alias_for']); } - app('log')->debug(sprintf('"%s" is an alias for "%s", so return that instead.', $original, $return)); + Log::debug(sprintf('"%s" is an alias for "%s", so return that instead.', $original, $return)); return $return; } - app('log')->debug(sprintf('"%s" is not an alias.', $operator)); + Log::debug(sprintf('"%s" is not an alias.', $operator)); return $original; } @@ -1937,7 +1987,7 @@ class OperatorQuerySearch implements SearchInterface */ private function searchAccount(string $value, SearchDirection $searchDirection, StringPosition $stringPosition, bool $prohibited = false): void { - app('log')->debug(sprintf('searchAccount("%s", %s, %s)', $value, $stringPosition->name, $searchDirection->name)); + Log::debug(sprintf('searchAccount("%s", %s, %s)', $value, $stringPosition->name, $searchDirection->name)); // search direction (default): for source accounts $searchTypes = [AccountTypeEnum::ASSET->value, AccountTypeEnum::MORTGAGE->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::REVENUE->value]; @@ -1980,28 +2030,30 @@ class OperatorQuerySearch implements SearchInterface // get accounts: $accounts = $this->accountRepository->searchAccount($value, $searchTypes, 1337); if (0 === $accounts->count() && false === $prohibited) { - app('log')->debug('Found zero accounts, search for non existing account, NO results will be returned.'); + Log::debug('Found zero accounts, search for non existing account, NO results will be returned.'); + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); return; } if (0 === $accounts->count() && true === $prohibited) { - app('log')->debug('Found zero accounts, but the search is negated, so effectively we ignore the search parameter.'); + Log::debug('Found zero accounts, but the search is negated, so effectively we ignore the search parameter.'); return; } - app('log')->debug(sprintf('Found %d accounts, will filter.', $accounts->count())); + Log::debug(sprintf('Found %d accounts, will filter.', $accounts->count())); $filtered = $accounts->filter( static fn (Account $account) => $stringMethod(strtolower($account->name), strtolower($value)) ); if (0 === $filtered->count()) { - app('log')->debug('Left with zero accounts, so cannot find anything, NO results will be returned.'); + Log::debug('Left with zero accounts, so cannot find anything, NO results will be returned.'); + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); return; } - app('log')->debug(sprintf('Left with %d, set as %s().', $filtered->count(), $collectorMethod)); + Log::debug(sprintf('Left with %d, set as %s().', $filtered->count(), $collectorMethod)); $this->collector->{$collectorMethod}($filtered); // @phpstan-ignore-line } @@ -2015,7 +2067,7 @@ class OperatorQuerySearch implements SearchInterface */ private function searchAccountNr(string $value, SearchDirection $searchDirection, StringPosition $stringPosition, bool $prohibited = false): void { - app('log')->debug(sprintf('searchAccountNr(%s, %d, %d)', $value, $searchDirection->name, $stringPosition->name)); + Log::debug(sprintf('searchAccountNr(%s, %d, %d)', $value, $searchDirection->name, $stringPosition->name)); // search direction (default): for source accounts $searchTypes = [AccountTypeEnum::ASSET->value, AccountTypeEnum::MORTGAGE->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::REVENUE->value]; @@ -2060,14 +2112,15 @@ class OperatorQuerySearch implements SearchInterface // search for accounts: $accounts = $this->accountRepository->searchAccountNr($value, $searchTypes, 1337); if (0 === $accounts->count()) { - app('log')->debug('Found zero accounts, search for invalid account.'); + Log::debug('Found zero accounts, search for invalid account.'); + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); return; } // if found, do filter - app('log')->debug(sprintf('Found %d accounts, will filter.', $accounts->count())); + Log::debug(sprintf('Found %d accounts, will filter.', $accounts->count())); $filtered = $accounts->filter( static function (Account $account) use ($value, $stringMethod) { // either IBAN or account number @@ -2086,12 +2139,13 @@ class OperatorQuerySearch implements SearchInterface ); if (0 === $filtered->count()) { - app('log')->debug('Left with zero, search for invalid account'); + Log::debug('Left with zero, search for invalid account'); + Log::warning(sprintf('Call to findNothing() from %s.', $operator)); $this->collector->findNothing(); return; } - app('log')->debug(sprintf('Left with %d, set as %s().', $filtered->count(), $collectorMethod)); + Log::debug(sprintf('Left with %d, set as %s().', $filtered->count(), $collectorMethod)); $this->collector->{$collectorMethod}($filtered); // @phpstan-ignore-line } @@ -2128,7 +2182,7 @@ class OperatorQuerySearch implements SearchInterface try { $parsedDate = $parser->parseDate($value); } catch (FireflyException) { - app('log')->debug(sprintf('Could not parse date "%s", will return empty array.', $value)); + Log::debug(sprintf('Could not parse date "%s", will return empty array.', $value)); $this->invalidOperators[] = [ 'type' => $type, 'value' => $value, @@ -2162,7 +2216,7 @@ class OperatorQuerySearch implements SearchInterface case 'exact': if ($value instanceof Carbon) { - app('log')->debug(sprintf('Set date_is_exact value "%s"', $value->format('Y-m-d'))); + Log::debug(sprintf('Set date_is_exact value "%s"', $value->format('Y-m-d'))); $this->collector->setRange($value, $value); $this->operators->push(['type' => 'date_on', 'value' => $value->format('Y-m-d')]); } @@ -2179,7 +2233,7 @@ class OperatorQuerySearch implements SearchInterface case 'year': if (is_string($value)) { - app('log')->debug(sprintf('Set date_is_exact YEAR value "%s"', $value)); + Log::debug(sprintf('Set date_is_exact YEAR value "%s"', $value)); $this->collector->yearIs($value); $this->operators->push(['type' => 'date_on_year', 'value' => $value]); } @@ -2188,7 +2242,7 @@ class OperatorQuerySearch implements SearchInterface case 'year_not': if (is_string($value)) { - app('log')->debug(sprintf('Set date_is_exact_not YEAR value "%s"', $value)); + Log::debug(sprintf('Set date_is_exact_not YEAR value "%s"', $value)); $this->collector->yearIsNot($value); $this->operators->push(['type' => 'not_date_on_year', 'value' => $value]); } @@ -2197,7 +2251,7 @@ class OperatorQuerySearch implements SearchInterface case 'month': if (is_string($value)) { - app('log')->debug(sprintf('Set date_is_exact MONTH value "%s"', $value)); + Log::debug(sprintf('Set date_is_exact MONTH value "%s"', $value)); $this->collector->monthIs($value); $this->operators->push(['type' => 'date_on_month', 'value' => $value]); } @@ -2206,7 +2260,7 @@ class OperatorQuerySearch implements SearchInterface case 'month_not': if (is_string($value)) { - app('log')->debug(sprintf('Set date_is_exact not MONTH value "%s"', $value)); + Log::debug(sprintf('Set date_is_exact not MONTH value "%s"', $value)); $this->collector->monthIsNot($value); $this->operators->push(['type' => 'not_date_on_month', 'value' => $value]); } @@ -2215,7 +2269,7 @@ class OperatorQuerySearch implements SearchInterface case 'day': if (is_string($value)) { - app('log')->debug(sprintf('Set date_is_exact DAY value "%s"', $value)); + Log::debug(sprintf('Set date_is_exact DAY value "%s"', $value)); $this->collector->dayIs($value); $this->operators->push(['type' => 'date_on_day', 'value' => $value]); } @@ -2224,7 +2278,7 @@ class OperatorQuerySearch implements SearchInterface case 'day_not': if (is_string($value)) { - app('log')->debug(sprintf('Set not date_is_exact DAY value "%s"', $value)); + Log::debug(sprintf('Set not date_is_exact DAY value "%s"', $value)); $this->collector->dayIsNot($value); $this->operators->push(['type' => 'not_date_on_day', 'value' => $value]); } @@ -2262,7 +2316,7 @@ class OperatorQuerySearch implements SearchInterface case 'year': if (is_string($value)) { - app('log')->debug(sprintf('Set date_is_before YEAR value "%s"', $value)); + Log::debug(sprintf('Set date_is_before YEAR value "%s"', $value)); $this->collector->yearBefore($value); $this->operators->push(['type' => 'date_before_year', 'value' => $value]); } @@ -2271,7 +2325,7 @@ class OperatorQuerySearch implements SearchInterface case 'month': if (is_string($value)) { - app('log')->debug(sprintf('Set date_is_before MONTH value "%s"', $value)); + Log::debug(sprintf('Set date_is_before MONTH value "%s"', $value)); $this->collector->monthBefore($value); $this->operators->push(['type' => 'date_before_month', 'value' => $value]); } @@ -2280,7 +2334,7 @@ class OperatorQuerySearch implements SearchInterface case 'day': if (is_string($value)) { - app('log')->debug(sprintf('Set date_is_before DAY value "%s"', $value)); + Log::debug(sprintf('Set date_is_before DAY value "%s"', $value)); $this->collector->dayBefore($value); $this->operators->push(['type' => 'date_before_day', 'value' => $value]); } @@ -2318,7 +2372,7 @@ class OperatorQuerySearch implements SearchInterface case 'year': if (is_string($value)) { - app('log')->debug(sprintf('Set date_is_after YEAR value "%s"', $value)); + Log::debug(sprintf('Set date_is_after YEAR value "%s"', $value)); $this->collector->yearAfter($value); $this->operators->push(['type' => 'date_after_year', 'value' => $value]); } @@ -2327,7 +2381,7 @@ class OperatorQuerySearch implements SearchInterface case 'month': if (is_string($value)) { - app('log')->debug(sprintf('Set date_is_after MONTH value "%s"', $value)); + Log::debug(sprintf('Set date_is_after MONTH value "%s"', $value)); $this->collector->monthAfter($value); $this->operators->push(['type' => 'date_after_month', 'value' => $value]); } @@ -2336,7 +2390,7 @@ class OperatorQuerySearch implements SearchInterface case 'day': if (is_string($value)) { - app('log')->debug(sprintf('Set date_is_after DAY value "%s"', $value)); + Log::debug(sprintf('Set date_is_after DAY value "%s"', $value)); $this->collector->dayAfter($value); $this->operators->push(['type' => 'date_after_day', 'value' => $value]); } @@ -2353,7 +2407,7 @@ class OperatorQuerySearch implements SearchInterface */ private function setExactMetaDateParams(string $field, array $range, bool $prohibited = false): void { - app('log')->debug('Now in setExactMetaDateParams()'); + Log::debug('Now in setExactMetaDateParams()'); /** * @var string $key @@ -2368,7 +2422,7 @@ class OperatorQuerySearch implements SearchInterface case 'exact': if ($value instanceof Carbon) { - app('log')->debug(sprintf('Set %s_is_exact value "%s"', $field, $value->format('Y-m-d'))); + Log::debug(sprintf('Set %s_is_exact value "%s"', $field, $value->format('Y-m-d'))); $this->collector->setMetaDateRange($value, $value, $field); $this->operators->push(['type' => sprintf('%s_on', $field), 'value' => $value->format('Y-m-d')]); } @@ -2377,7 +2431,7 @@ class OperatorQuerySearch implements SearchInterface case 'exact_not': if ($value instanceof Carbon) { - app('log')->debug(sprintf('Set NOT %s_is_exact value "%s"', $field, $value->format('Y-m-d'))); + Log::debug(sprintf('Set NOT %s_is_exact value "%s"', $field, $value->format('Y-m-d'))); $this->collector->excludeMetaDateRange($value, $value, $field); $this->operators->push(['type' => sprintf('not_%s_on', $field), 'value' => $value->format('Y-m-d')]); } @@ -2386,7 +2440,7 @@ class OperatorQuerySearch implements SearchInterface case 'year': if (is_string($value)) { - app('log')->debug(sprintf('Set %s_is_exact YEAR value "%s"', $field, $value)); + Log::debug(sprintf('Set %s_is_exact YEAR value "%s"', $field, $value)); $this->collector->metaYearIs($value, $field); $this->operators->push(['type' => sprintf('%s_on_year', $field), 'value' => $value]); } @@ -2395,7 +2449,7 @@ class OperatorQuerySearch implements SearchInterface case 'year_not': if (is_string($value)) { - app('log')->debug(sprintf('Set NOT %s_is_exact YEAR value "%s"', $field, $value)); + Log::debug(sprintf('Set NOT %s_is_exact YEAR value "%s"', $field, $value)); $this->collector->metaYearIsNot($value, $field); $this->operators->push(['type' => sprintf('not_%s_on_year', $field), 'value' => $value]); } @@ -2404,7 +2458,7 @@ class OperatorQuerySearch implements SearchInterface case 'month': if (is_string($value)) { - app('log')->debug(sprintf('Set %s_is_exact MONTH value "%s"', $field, $value)); + Log::debug(sprintf('Set %s_is_exact MONTH value "%s"', $field, $value)); $this->collector->metaMonthIs($value, $field); $this->operators->push(['type' => sprintf('%s_on_month', $field), 'value' => $value]); } @@ -2413,7 +2467,7 @@ class OperatorQuerySearch implements SearchInterface case 'month_not': if (is_string($value)) { - app('log')->debug(sprintf('Set NOT %s_is_exact MONTH value "%s"', $field, $value)); + Log::debug(sprintf('Set NOT %s_is_exact MONTH value "%s"', $field, $value)); $this->collector->metaMonthIsNot($value, $field); $this->operators->push(['type' => sprintf('not_%s_on_month', $field), 'value' => $value]); } @@ -2422,7 +2476,7 @@ class OperatorQuerySearch implements SearchInterface case 'day': if (is_string($value)) { - app('log')->debug(sprintf('Set %s_is_exact DAY value "%s"', $field, $value)); + Log::debug(sprintf('Set %s_is_exact DAY value "%s"', $field, $value)); $this->collector->metaDayIs($value, $field); $this->operators->push(['type' => sprintf('%s_on_day', $field), 'value' => $value]); } @@ -2431,7 +2485,7 @@ class OperatorQuerySearch implements SearchInterface case 'day_not': if (is_string($value)) { - app('log')->debug(sprintf('Set NOT %s_is_exact DAY value "%s"', $field, $value)); + Log::debug(sprintf('Set NOT %s_is_exact DAY value "%s"', $field, $value)); $this->collector->metaDayIsNot($value, $field); $this->operators->push(['type' => sprintf('not_%s_on_day', $field), 'value' => $value]); } @@ -2469,7 +2523,7 @@ class OperatorQuerySearch implements SearchInterface case 'year': if (is_string($value)) { - app('log')->debug(sprintf('Set %s_is_before YEAR value "%s"', $field, $value)); + Log::debug(sprintf('Set %s_is_before YEAR value "%s"', $field, $value)); $this->collector->metaYearBefore($value, $field); $this->operators->push(['type' => sprintf('%s_before_year', $field), 'value' => $value]); } @@ -2478,7 +2532,7 @@ class OperatorQuerySearch implements SearchInterface case 'month': if (is_string($value)) { - app('log')->debug(sprintf('Set %s_is_before MONTH value "%s"', $field, $value)); + Log::debug(sprintf('Set %s_is_before MONTH value "%s"', $field, $value)); $this->collector->metaMonthBefore($value, $field); $this->operators->push(['type' => sprintf('%s_before_month', $field), 'value' => $value]); } @@ -2487,7 +2541,7 @@ class OperatorQuerySearch implements SearchInterface case 'day': if (is_string($value)) { - app('log')->debug(sprintf('Set %s_is_before DAY value "%s"', $field, $value)); + Log::debug(sprintf('Set %s_is_before DAY value "%s"', $field, $value)); $this->collector->metaDayBefore($value, $field); $this->operators->push(['type' => sprintf('%s_before_day', $field), 'value' => $value]); } @@ -2525,7 +2579,7 @@ class OperatorQuerySearch implements SearchInterface case 'year': if (is_string($value)) { - app('log')->debug(sprintf('Set %s_is_after YEAR value "%s"', $field, $value)); + Log::debug(sprintf('Set %s_is_after YEAR value "%s"', $field, $value)); $this->collector->metaYearAfter($value, $field); $this->operators->push(['type' => sprintf('%s_after_year', $field), 'value' => $value]); } @@ -2534,7 +2588,7 @@ class OperatorQuerySearch implements SearchInterface case 'month': if (is_string($value)) { - app('log')->debug(sprintf('Set %s_is_after MONTH value "%s"', $field, $value)); + Log::debug(sprintf('Set %s_is_after MONTH value "%s"', $field, $value)); $this->collector->metaMonthAfter($value, $field); $this->operators->push(['type' => sprintf('%s_after_month', $field), 'value' => $value]); } @@ -2543,7 +2597,7 @@ class OperatorQuerySearch implements SearchInterface case 'day': if (is_string($value)) { - app('log')->debug(sprintf('Set %s_is_after DAY value "%s"', $field, $value)); + Log::debug(sprintf('Set %s_is_after DAY value "%s"', $field, $value)); $this->collector->metaDayAfter($value, $field); $this->operators->push(['type' => sprintf('%s_after_day', $field), 'value' => $value]); } @@ -2573,7 +2627,7 @@ class OperatorQuerySearch implements SearchInterface case 'exact': if ($value instanceof Carbon) { - app('log')->debug(sprintf('Set %s_is_exact value "%s"', $field, $value->format('Y-m-d'))); + Log::debug(sprintf('Set %s_is_exact value "%s"', $field, $value->format('Y-m-d'))); $this->collector->setObjectRange($value, clone $value, $field); $this->operators->push(['type' => sprintf('%s_on', $field), 'value' => $value->format('Y-m-d')]); } @@ -2582,7 +2636,7 @@ class OperatorQuerySearch implements SearchInterface case 'exact_not': if ($value instanceof Carbon) { - app('log')->debug(sprintf('Set NOT %s_is_exact value "%s"', $field, $value->format('Y-m-d'))); + Log::debug(sprintf('Set NOT %s_is_exact value "%s"', $field, $value->format('Y-m-d'))); $this->collector->excludeObjectRange($value, clone $value, $field); $this->operators->push(['type' => sprintf('not_%s_on', $field), 'value' => $value->format('Y-m-d')]); } @@ -2591,7 +2645,7 @@ class OperatorQuerySearch implements SearchInterface case 'year': if (is_string($value)) { - app('log')->debug(sprintf('Set %s_is_exact YEAR value "%s"', $field, $value)); + Log::debug(sprintf('Set %s_is_exact YEAR value "%s"', $field, $value)); $this->collector->objectYearIs($value, $field); $this->operators->push(['type' => sprintf('%s_on_year', $field), 'value' => $value]); } @@ -2600,7 +2654,7 @@ class OperatorQuerySearch implements SearchInterface case 'year_not': if (is_string($value)) { - app('log')->debug(sprintf('Set NOT %s_is_exact YEAR value "%s"', $field, $value)); + Log::debug(sprintf('Set NOT %s_is_exact YEAR value "%s"', $field, $value)); $this->collector->objectYearIsNot($value, $field); $this->operators->push(['type' => sprintf('not_%s_on_year', $field), 'value' => $value]); } @@ -2609,7 +2663,7 @@ class OperatorQuerySearch implements SearchInterface case 'month': if (is_string($value)) { - app('log')->debug(sprintf('Set %s_is_exact MONTH value "%s"', $field, $value)); + Log::debug(sprintf('Set %s_is_exact MONTH value "%s"', $field, $value)); $this->collector->objectMonthIs($value, $field); $this->operators->push(['type' => sprintf('%s_on_month', $field), 'value' => $value]); } @@ -2618,7 +2672,7 @@ class OperatorQuerySearch implements SearchInterface case 'month_not': if (is_string($value)) { - app('log')->debug(sprintf('Set NOT %s_is_exact MONTH value "%s"', $field, $value)); + Log::debug(sprintf('Set NOT %s_is_exact MONTH value "%s"', $field, $value)); $this->collector->objectMonthIsNot($value, $field); $this->operators->push(['type' => sprintf('not_%s_on_month', $field), 'value' => $value]); } @@ -2627,7 +2681,7 @@ class OperatorQuerySearch implements SearchInterface case 'day': if (is_string($value)) { - app('log')->debug(sprintf('Set %s_is_exact DAY value "%s"', $field, $value)); + Log::debug(sprintf('Set %s_is_exact DAY value "%s"', $field, $value)); $this->collector->objectDayIs($value, $field); $this->operators->push(['type' => sprintf('%s_on_day', $field), 'value' => $value]); } @@ -2636,7 +2690,7 @@ class OperatorQuerySearch implements SearchInterface case 'day_not': if (is_string($value)) { - app('log')->debug(sprintf('Set NOT %s_is_exact DAY value "%s"', $field, $value)); + Log::debug(sprintf('Set NOT %s_is_exact DAY value "%s"', $field, $value)); $this->collector->objectDayIsNot($value, $field); $this->operators->push(['type' => sprintf('not_%s_on_day', $field), 'value' => $value]); } @@ -2674,7 +2728,7 @@ class OperatorQuerySearch implements SearchInterface case 'year': if (is_string($value)) { - app('log')->debug(sprintf('Set date_is_before YEAR value "%s"', $value)); + Log::debug(sprintf('Set date_is_before YEAR value "%s"', $value)); $this->collector->objectYearBefore($value, $field); $this->operators->push(['type' => sprintf('%s_before_year', $field), 'value' => $value]); } @@ -2683,7 +2737,7 @@ class OperatorQuerySearch implements SearchInterface case 'month': if (is_string($value)) { - app('log')->debug(sprintf('Set date_is_before MONTH value "%s"', $value)); + Log::debug(sprintf('Set date_is_before MONTH value "%s"', $value)); $this->collector->objectMonthBefore($value, $field); $this->operators->push(['type' => sprintf('%s_before_month', $field), 'value' => $value]); } @@ -2692,7 +2746,7 @@ class OperatorQuerySearch implements SearchInterface case 'day': if (is_string($value)) { - app('log')->debug(sprintf('Set date_is_before DAY value "%s"', $value)); + Log::debug(sprintf('Set date_is_before DAY value "%s"', $value)); $this->collector->objectDayBefore($value, $field); $this->operators->push(['type' => sprintf('%s_before_day', $field), 'value' => $value]); } @@ -2730,7 +2784,7 @@ class OperatorQuerySearch implements SearchInterface case 'year': if (is_string($value)) { - app('log')->debug(sprintf('Set date_is_after YEAR value "%s"', $value)); + Log::debug(sprintf('Set date_is_after YEAR value "%s"', $value)); $this->collector->objectYearAfter($value, $field); $this->operators->push(['type' => sprintf('%s_after_year', $field), 'value' => $value]); } @@ -2739,7 +2793,7 @@ class OperatorQuerySearch implements SearchInterface case 'month': if (is_string($value)) { - app('log')->debug(sprintf('Set date_is_after MONTH value "%s"', $value)); + Log::debug(sprintf('Set date_is_after MONTH value "%s"', $value)); $this->collector->objectMonthAfter($value, $field); $this->operators->push(['type' => sprintf('%s_after_month', $field), 'value' => $value]); } @@ -2748,7 +2802,7 @@ class OperatorQuerySearch implements SearchInterface case 'day': if (is_string($value)) { - app('log')->debug(sprintf('Set date_is_after DAY value "%s"', $value)); + Log::debug(sprintf('Set date_is_after DAY value "%s"', $value)); $this->collector->objectDayAfter($value, $field); $this->operators->push(['type' => sprintf('%s_after_day', $field), 'value' => $value]); } @@ -2784,29 +2838,29 @@ class OperatorQuerySearch implements SearchInterface private function parseTagInstructions(): void { - app('log')->debug('Now in parseTagInstructions()'); + Log::debug('Now in parseTagInstructions()'); // if exclude tags, remove excluded tags. if (count($this->excludeTags) > 0) { - app('log')->debug(sprintf('%d exclude tag(s)', count($this->excludeTags))); + Log::debug(sprintf('%d exclude tag(s)', count($this->excludeTags))); $collection = new Collection(); foreach ($this->excludeTags as $tagId) { $tag = $this->tagRepository->find($tagId); if (null !== $tag) { - app('log')->debug(sprintf('Exclude tag "%s"', $tag->tag)); + Log::debug(sprintf('Exclude tag "%s"', $tag->tag)); $collection->push($tag); } } - app('log')->debug(sprintf('Selecting all tags except %d excluded tag(s).', $collection->count())); + Log::debug(sprintf('Selecting all tags except %d excluded tag(s).', $collection->count())); $this->collector->setWithoutSpecificTags($collection); } // if include tags, include them: if (count($this->includeTags) > 0) { - app('log')->debug(sprintf('%d include tag(s)', count($this->includeTags))); + Log::debug(sprintf('%d include tag(s)', count($this->includeTags))); $collection = new Collection(); foreach ($this->includeTags as $tagId) { $tag = $this->tagRepository->find($tagId); if (null !== $tag) { - app('log')->debug(sprintf('Include tag "%s"', $tag->tag)); + Log::debug(sprintf('Include tag "%s"', $tag->tag)); $collection->push($tag); } } @@ -2814,12 +2868,12 @@ class OperatorQuerySearch implements SearchInterface } // if include ANY tags, include them: (see #8632) if (count($this->includeAnyTags) > 0) { - app('log')->debug(sprintf('%d include ANY tag(s)', count($this->includeAnyTags))); + Log::debug(sprintf('%d include ANY tag(s)', count($this->includeAnyTags))); $collection = new Collection(); foreach ($this->includeAnyTags as $tagId) { $tag = $this->tagRepository->find($tagId); if (null !== $tag) { - app('log')->debug(sprintf('Include ANY tag "%s"', $tag->tag)); + Log::debug(sprintf('Include ANY tag "%s"', $tag->tag)); $collection->push($tag); } }