Add some debug info.

This commit is contained in:
James Cole 2023-12-29 08:21:14 +01:00
parent 6381d04e2b
commit c08d44ea48
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
14 changed files with 32 additions and 6 deletions

View File

@ -39,6 +39,7 @@ use FireflyIII\Support\Http\Api\ExchangeRateConverter;
use FireflyIII\Support\Http\Api\ValidatesUserGroupTrait;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
/**
* Class BudgetController
@ -177,6 +178,7 @@ class BudgetController extends Controller
*/
private function processExpenses(int $budgetId, array $array, Carbon $start, Carbon $end): array
{
Log::info(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
$converter = new ExchangeRateConverter();
$return = [];
@ -258,6 +260,7 @@ class BudgetController extends Controller
*/
private function processLimit(Budget $budget, BudgetLimit $limit): array
{
Log::info(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
$end = clone $limit->end_date;
$end->endOfDay();
$spent = $this->opsRepository->listExpenses($limit->start_date, $end, null, new Collection([$budget]));

View File

@ -37,6 +37,7 @@ use FireflyIII\Support\Http\Api\CleansChartData;
use FireflyIII\Support\Http\Api\ExchangeRateConverter;
use FireflyIII\Support\Http\Api\ValidatesUserGroupTrait;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Log;
/**
* Class BudgetController
@ -76,6 +77,7 @@ class CategoryController extends Controller
*/
public function dashboard(DateRequest $request): JsonResponse
{
Log::info(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
/** @var Carbon $start */
$start = $this->parameters->get('start');

View File

@ -45,6 +45,7 @@ use FireflyIII\Support\Http\Api\SummaryBalanceGrouped;
use FireflyIII\Support\Http\Api\ValidatesUserGroupTrait;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Log;
/**
* Class BasicController
@ -244,6 +245,7 @@ class BasicController extends Controller
*/
private function getLeftToSpendInfo(Carbon $start, Carbon $end): array
{
Log::info(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
app('log')->debug('Now in getLeftToSpendInfo');
$return = [];
$today = today(config('app.timezone'));

View File

@ -32,6 +32,7 @@ use FireflyIII\Support\Cronjobs\BillWarningCronjob;
use FireflyIII\Support\Cronjobs\ExchangeRatesCronjob;
use FireflyIII\Support\Cronjobs\RecurringCronjob;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;
/**
* Class Cron
@ -103,6 +104,7 @@ class Cron extends Command
private function exchangeRatesCronJob(bool $force, ?Carbon $date): void
{
Log::info(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
$exchangeRates = new ExchangeRatesCronjob();
$exchangeRates->setForce($force);
// set date in cron job:

View File

@ -36,6 +36,7 @@ use FireflyIII\Support\Http\Api\ExchangeRateConverter;
use FireflyIII\User;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
/**
* This class can handle both request with and without a user group and will return the appropriate repository when
@ -72,7 +73,7 @@ class NetWorth implements NetWorthInterface
return $cache->get();
}
app('log')->debug(sprintf('Now in byAccounts("%s", "%s")', $ids, $date->format('Y-m-d')));
Log::info(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
$default = app('amount')->getDefaultCurrency();
$converter = new ExchangeRateConverter();

View File

@ -32,6 +32,7 @@ use FireflyIII\Support\CacheProperties;
use FireflyIII\Support\Http\Api\ExchangeRateConverter;
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
/**
* Class BillRepository
@ -66,6 +67,7 @@ class BillRepository implements BillRepositoryInterface
public function sumPaidInRange(Carbon $start, Carbon $end): array
{
Log::info(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
$bills = $this->getActiveBills();
$default = app('amount')->getDefaultCurrency();
$return = [];
@ -134,6 +136,7 @@ class BillRepository implements BillRepositoryInterface
public function sumUnpaidInRange(Carbon $start, Carbon $end): array
{
Log::info(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
$bills = $this->getActiveBills();
$return = [];
$default = app('amount')->getDefaultCurrency();

View File

@ -28,6 +28,7 @@ use Carbon\Carbon;
use FireflyIII\Models\AvailableBudget;
use FireflyIII\Support\Http\Api\ExchangeRateConverter;
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
use Illuminate\Support\Facades\Log;
/**
* Class AvailableBudgetRepository
@ -38,6 +39,7 @@ class AvailableBudgetRepository implements AvailableBudgetRepositoryInterface
public function getAvailableBudgetWithCurrency(Carbon $start, Carbon $end): array
{
Log::info(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
$return = [];
$converter = new ExchangeRateConverter();
$default = app('amount')->getDefaultCurrency();

View File

@ -28,6 +28,7 @@ use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Models\TransactionType;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
/**
* Class AccountBalanceGrouped
@ -117,6 +118,7 @@ class AccountBalanceGrouped
*/
public function groupByCurrencyAndPeriod(): void
{
Log::info(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
$converter = new ExchangeRateConverter();
// loop. group by currency and by period.

View File

@ -25,6 +25,7 @@ namespace FireflyIII\Support\Http\Api;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Repositories\UserGroups\Currency\CurrencyRepositoryInterface;
use Illuminate\Support\Facades\Log;
class SummaryBalanceGrouped
{
@ -44,7 +45,8 @@ class SummaryBalanceGrouped
public function groupTransactions(string $key, array $journals): void
{
\Log::debug(sprintf('Now in groupTransactions with key "%s" and %d journal(s)', $key, count($journals)));
Log::info(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
Log::debug(sprintf('Now in groupTransactions with key "%s" and %d journal(s)', $key, count($journals)));
$converter = new ExchangeRateConverter();
$this->keys[] = $key;
$multiplier = 'income' === $key ? '-1' : '1';

View File

@ -239,7 +239,7 @@ class Steam
$balances[$formatted] = $startBalance;
app('log')->debug(sprintf('Start balance on %s is %s', $formatted, $startBalance));
Log::info(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
$converter = new ExchangeRateConverter();
// not sure why this is happening:
@ -422,6 +422,7 @@ class Steam
// need to convert the others. All sets use the "amount" value as their base (that's easy)
// but we need to convert each transaction separately because the date difference may
// incur huge currency changes.
Log::info(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
$start = clone $date;
$end = clone $date;
$converter = new ExchangeRateConverter();

View File

@ -34,6 +34,7 @@ use FireflyIII\Models\TransactionJournal;
use FireflyIII\Support\Http\Api\ExchangeRateConverter;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
/**
* Class BillTransformer
@ -92,6 +93,7 @@ class BillTransformer extends AbstractTransformer
'object_group_order' => $order,
];
}
Log::info(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
$this->default = app('amount')->getDefaultCurrency();
$this->converter = new ExchangeRateConverter();

View File

@ -36,6 +36,7 @@ use FireflyIII\Models\TransactionJournal;
use FireflyIII\Support\Http\Api\ExchangeRateConverter;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
/**
* Class PiggyBankTransformer
@ -131,6 +132,7 @@ class PiggyBankTransformer extends AbstractTransformer
$this->notes[$id] = $note;
}
Log::info(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
$this->default = app('amount')->getDefaultCurrencyByUserGroup(auth()->user()->userGroup);
$this->converter = new ExchangeRateConverter();
}

View File

@ -35,6 +35,7 @@ use FireflyIII\Support\Http\Api\ExchangeRateConverter;
use FireflyIII\Support\NullArrayObject;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
/**
* Class TransactionGroupTransformer
@ -102,6 +103,7 @@ class TransactionGroupTransformer extends AbstractTransformer
}
// create converter
Log::info(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
$this->converter = new ExchangeRateConverter();
}