Skip to content

Firefly III: a personal finances manager

Even more debug

James Cole7aa3aef508ec
diff --git a/app/Support/Http/Api/ExchangeRateConverter.php b/app/Support/Http/Api/ExchangeRateConverter.php
index e429def2a7..4059627652 100644
--- a/app/Support/Http/Api/ExchangeRateConverter.php
+++ b/app/Support/Http/Api/ExchangeRateConverter.php
@@ -54,7 +54,7 @@ class ExchangeRateConverter
{
$start->startOfDay();
$end->endOfDay();
- Log::debug(sprintf('Preparing for %s to %s between %s and %s', $from->code, $to->code, $start->format('Y-m-d'), $end->format('Y-m-d')));
+ Log::info(sprintf('Preparing for %s to %s between %s and %s', $from->code, $to->code, $start->format('Y-m-d'), $end->format('Y-m-d')));
$set = auth()->user()
->currencyExchangeRates()
->where('from_currency_id', $from->id)
@@ -66,7 +66,7 @@ class ExchangeRateConverter
$fallback = $this->getRate($from, $to, $start);
++$this->queryCount;
if (0 === $set->count()) {
- Log::debug('No rates found in this period.');
+ Log::info('No rates found in this period.');
return;
}
@@ -86,7 +86,7 @@ class ExchangeRateConverter
];
++$count;
}
- Log::debug(sprintf('Found %d rates in this period.', $count));
+ Log::info(sprintf('Found %d rates in this period.', $count));
$currentStart = clone $start;
while ($currentStart->lte($end)) {
$currentDate = $currentStart->format('Y-m-d');
@@ -157,6 +157,7 @@ class ExchangeRateConverter
// perhaps the rate has been cached during this particular run
$preparedRate = $this->prepared[$date][$from][$to] ?? null;
if (null !== $preparedRate && 0 !== bccomp('0', $preparedRate)) {
+ Log::info(sprintf('Found prepared rate from #%d to #%d on %s.', $from, $to, $date));
return $preparedRate;
}
@@ -167,10 +168,11 @@ class ExchangeRateConverter
if ('' === $rate) {
return null;
}
+ Log::info(sprintf('Found cached rate from #%d to #%d on %s.', $from, $to, $date));
return $rate;
}
- app('log')->debug(sprintf('Going to get rate #%d->#%d (%s) from DB.', $from, $to, $date));
+ app('log')->info(sprintf('Going to get rate #%d->#%d (%s) from DB.', $from, $to, $date));
/** @var null|CurrencyExchangeRate $result */
$result = auth()->user()