Replace log.

This commit is contained in:
James Cole
2025-10-05 12:49:39 +02:00
parent 362705ec71
commit 072212c112
39 changed files with 194 additions and 195 deletions

View File

@@ -30,6 +30,7 @@ use FireflyIII\Models\TransactionJournal;
use Illuminate\Console\Command;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
class RemovesEmptyJournals extends Command
{
@@ -68,8 +69,8 @@ class RemovesEmptyJournals extends Command
$journal = TransactionJournal::find($row->transaction_journal_id);
$journal?->delete();
} catch (QueryException $e) {
app('log')->info(sprintf('Could not delete journal: %s', $e->getMessage()));
app('log')->error($e->getTraceAsString());
Log::info(sprintf('Could not delete journal: %s', $e->getMessage()));
Log::error($e->getTraceAsString());
}
Transaction::where('transaction_journal_id', $row->transaction_journal_id)->delete();
@@ -96,8 +97,8 @@ class RemovesEmptyJournals extends Command
$journal = TransactionJournal::find($entry->id);
$journal?->delete();
} catch (QueryException $e) {
app('log')->info(sprintf('Could not delete entry: %s', $e->getMessage()));
app('log')->error($e->getTraceAsString());
Log::info(sprintf('Could not delete entry: %s', $e->getMessage()));
Log::error($e->getTraceAsString());
}
$this->friendlyInfo(sprintf('Deleted empty transaction journal #%d', $entry->id));