Add some logging

This commit is contained in:
James Cole 2019-12-22 07:50:10 +01:00
parent af063191ab
commit 4111973a06
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -27,6 +27,7 @@ use Exception;
use FireflyIII\Models\TransactionGroup;
use FireflyIII\Models\TransactionJournal;
use Illuminate\Console\Command;
use Log;
/**
* Class DeleteEmptyGroups
@ -54,6 +55,7 @@ class DeleteEmptyGroups extends Command
*/
public function handle(): int
{
Log::debug(sprintf('Now in %s', __METHOD__));
$start = microtime(true);
$groupIds =
TransactionGroup
@ -61,6 +63,7 @@ class DeleteEmptyGroups extends Command
->whereNull('transaction_journals.id')->get(['transaction_groups.id'])->pluck('id')->toArray();
$total = count($groupIds);
Log::debug(sprintf('Count is %d', $total));
if ($total > 0) {
$this->info(sprintf('Deleted %d empty transaction group(s).', $total));