mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Remove static references
This commit is contained in:
parent
91b7d20f9b
commit
e65d0eef6e
@ -303,12 +303,12 @@ class DestroyController extends Controller
|
||||
foreach ($collection as $account) {
|
||||
$count = $account->transactions()->count();
|
||||
if (true === $this->unused && 0 === $count) {
|
||||
Log::info(sprintf('Deleted unused account #%d "%s"', $account->id, $account->name));
|
||||
app('log')->info(sprintf('Deleted unused account #%d "%s"', $account->id, $account->name));
|
||||
$service->destroy($account, null);
|
||||
continue;
|
||||
}
|
||||
if (false === $this->unused) {
|
||||
Log::info(sprintf('Deleting account #%d "%s"', $account->id, $account->name));
|
||||
app('log')->info(sprintf('Deleting account #%d "%s"', $account->id, $account->name));
|
||||
$service->destroy($account, null);
|
||||
}
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ class DeleteEmptyJournals extends Command
|
||||
try {
|
||||
TransactionJournal::find((int)$row->transaction_journal_id)->delete();
|
||||
} catch (QueryException $e) {
|
||||
Log::info(sprintf('Could not delete journal: %s', $e->getMessage()));
|
||||
app('log')->info(sprintf('Could not delete journal: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ class DeleteEmptyJournals extends Command
|
||||
try {
|
||||
TransactionJournal::find($entry->id)->delete();
|
||||
} catch (QueryException $e) {
|
||||
Log::info(sprintf('Could not delete entry: %s', $e->getMessage()));
|
||||
app('log')->info(sprintf('Could not delete entry: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
}
|
||||
|
||||
|
@ -209,7 +209,7 @@ class ExportData extends Command
|
||||
}
|
||||
}
|
||||
if (null === $this->option($field)) {
|
||||
Log::info(sprintf('No date given in field "%s"', $field));
|
||||
app('log')->info(sprintf('No date given in field "%s"', $field));
|
||||
$error = true;
|
||||
}
|
||||
|
||||
|
@ -626,7 +626,7 @@ class TransactionJournalFactory
|
||||
{
|
||||
$this->errorOnHash = $errorOnHash;
|
||||
if (true === $errorOnHash) {
|
||||
Log::info('Will trigger duplication alert for this journal.');
|
||||
app('log')->info('Will trigger duplication alert for this journal.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ class StoredGroupEventHandler
|
||||
public function processRules(StoredTransactionGroup $storedGroupEvent): void
|
||||
{
|
||||
if (false === $storedGroupEvent->applyRules) {
|
||||
Log::info(sprintf('Will not run rules on group #%d', $storedGroupEvent->transactionGroup->id));
|
||||
app('log')->info(sprintf('Will not run rules on group #%d', $storedGroupEvent->transactionGroup->id));
|
||||
|
||||
return;
|
||||
}
|
||||
@ -100,7 +100,7 @@ class StoredGroupEventHandler
|
||||
Log::debug(__METHOD__);
|
||||
$group = $storedGroupEvent->transactionGroup;
|
||||
if (false === $storedGroupEvent->fireWebhooks) {
|
||||
Log::info(sprintf('Will not fire webhooks for transaction group #%d', $group->id));
|
||||
app('log')->info(sprintf('Will not fire webhooks for transaction group #%d', $group->id));
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ class UpdatedGroupEventHandler
|
||||
public function processRules(UpdatedTransactionGroup $updatedGroupEvent): void
|
||||
{
|
||||
if (false === $updatedGroupEvent->applyRules) {
|
||||
Log::info(sprintf('Will not run rules on group #%d', $updatedGroupEvent->transactionGroup->id));
|
||||
app('log')->info(sprintf('Will not run rules on group #%d', $updatedGroupEvent->transactionGroup->id));
|
||||
|
||||
return;
|
||||
}
|
||||
@ -98,7 +98,7 @@ class UpdatedGroupEventHandler
|
||||
Log::debug(__METHOD__);
|
||||
$group = $updatedGroupEvent->transactionGroup;
|
||||
if (false === $updatedGroupEvent->fireWebhooks) {
|
||||
Log::info(sprintf('Will not fire webhooks for transaction group #%d', $group->id));
|
||||
app('log')->info(sprintf('Will not fire webhooks for transaction group #%d', $group->id));
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ class UserEventHandler
|
||||
Log::error('Could not find role "owner". This is weird.');
|
||||
}
|
||||
|
||||
Log::info(sprintf('Gave user #%d role #%d ("%s")', $user->id, $role->id, $role->name));
|
||||
app('log')->info(sprintf('Gave user #%d role #%d ("%s")', $user->id, $role->id, $role->name));
|
||||
// give user the role
|
||||
$repository->attachRole($user, 'owner');
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ class ForgotPasswordController extends Controller
|
||||
*/
|
||||
public function sendResetLinkEmail(Request $request, UserRepositoryInterface $repository)
|
||||
{
|
||||
Log::info('Start of sendResetLinkEmail()');
|
||||
app('log')->info('Start of sendResetLinkEmail()');
|
||||
if ('web' !== config('firefly.authentication_guard')) {
|
||||
$message = sprintf('Cannot reset password when authenticating over "%s".', config('firefly.authentication_guard'));
|
||||
Log::error($message);
|
||||
|
@ -87,7 +87,7 @@ class LoginController extends Controller
|
||||
public function login(Request $request)
|
||||
{
|
||||
Log::channel('audit')->info(sprintf('User is trying to login using "%s"', $request->get($this->username())));
|
||||
Log::info('User is trying to login.');
|
||||
app('log')->info('User is trying to login.');
|
||||
|
||||
$this->validateLogin($request);
|
||||
Log::debug('Login data is present.');
|
||||
|
@ -98,7 +98,7 @@ class RegisterController extends Controller
|
||||
|
||||
$this->validator($request->all())->validate();
|
||||
$user = $this->createUser($request->all());
|
||||
Log::info(sprintf('Registered new user %s', $user->email));
|
||||
app('log')->info(sprintf('Registered new user %s', $user->email));
|
||||
event(new RegisteredUser($user));
|
||||
|
||||
$this->guard()->login($user);
|
||||
|
@ -70,7 +70,7 @@ class DebugController extends Controller
|
||||
public function displayError(): void
|
||||
{
|
||||
Log::debug('This is a test message at the DEBUG level.');
|
||||
Log::info('This is a test message at the INFO level.');
|
||||
app('log')->info('This is a test message at the INFO level.');
|
||||
Log::notice('This is a test message at the NOTICE level.');
|
||||
app('log')->warning('This is a test message at the WARNING level.');
|
||||
Log::error('This is a test message at the ERROR level.');
|
||||
|
@ -595,7 +595,7 @@ class ProfileController extends Controller
|
||||
}
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
Log::info(sprintf('User #%d has opted to delete their account', auth()->user()->id));
|
||||
app('log')->info(sprintf('User #%d has opted to delete their account', auth()->user()->id));
|
||||
// make repository delete user:
|
||||
auth()->logout();
|
||||
session()->flush();
|
||||
|
@ -55,7 +55,7 @@ class TriggerController extends Controller
|
||||
$backupDate = $recurrence->latest_date;
|
||||
|
||||
// fire the recurring cron job on the given date, then post-date the created transaction.
|
||||
Log::info(sprintf('Trigger: will now fire recurring cron job task for date "%s".', $date->format('Y-m-d H:i:s')));
|
||||
app('log')->info(sprintf('Trigger: will now fire recurring cron job task for date "%s".', $date->format('Y-m-d H:i:s')));
|
||||
/** @var CreateRecurringTransactions $job */
|
||||
$job = app(CreateRecurringTransactions::class);
|
||||
$job->setRecurrences(new Collection([$recurrence]));
|
||||
|
@ -171,7 +171,7 @@ class InstallController extends Controller
|
||||
// switch on PHP version.
|
||||
$keys = [];
|
||||
// switch on class existence.
|
||||
Log::info('Will run PHP8 code.');
|
||||
app('log')->info('Will run PHP8 code.');
|
||||
$keys = RSA::createKey(4096);
|
||||
|
||||
[$publicKey, $privateKey] = [
|
||||
|
@ -160,7 +160,7 @@ class Installer
|
||||
return true;
|
||||
}
|
||||
|
||||
//Log::info(sprintf('Configured DB version (%d) equals expected DB version (%d)', $dbVersion, $configVersion));
|
||||
//app('log')->info(sprintf('Configured DB version (%d) equals expected DB version (%d)', $dbVersion, $configVersion));
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -187,7 +187,7 @@ class Installer
|
||||
return true;
|
||||
}
|
||||
|
||||
//Log::info(sprintf('Installed Firefly III version (%s) equals expected Firefly III version (%s)', $dbVersion, $configVersion));
|
||||
//app('log')->info(sprintf('Installed Firefly III version (%s) equals expected Firefly III version (%s)', $dbVersion, $configVersion));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ class IsDemoUser
|
||||
/** @var UserRepositoryInterface $repository */
|
||||
$repository = app(UserRepositoryInterface::class);
|
||||
if ($repository->hasRole($user, 'demo')) {
|
||||
Log::info('User is a demo user.');
|
||||
app('log')->info('User is a demo user.');
|
||||
$request->session()->flash('info', (string)trans('firefly.not_available_demo_user'));
|
||||
$current = $request->url();
|
||||
$previous = $request->session()->previousUrl();
|
||||
|
@ -89,18 +89,18 @@ class CreateAutoBudgetLimits implements ShouldQueue
|
||||
private function handleAutoBudget(AutoBudget $autoBudget): void
|
||||
{
|
||||
if (null === $autoBudget->budget) {
|
||||
Log::info(sprintf('Auto budget #%d is associated with a deleted budget.', $autoBudget->id));
|
||||
app('log')->info(sprintf('Auto budget #%d is associated with a deleted budget.', $autoBudget->id));
|
||||
$autoBudget->delete();
|
||||
|
||||
return;
|
||||
}
|
||||
if (false === $autoBudget->budget->active) {
|
||||
Log::info(sprintf('Auto budget #%d is associated with an inactive budget.', $autoBudget->id));
|
||||
app('log')->info(sprintf('Auto budget #%d is associated with an inactive budget.', $autoBudget->id));
|
||||
|
||||
return;
|
||||
}
|
||||
if (!$this->isMagicDay($autoBudget)) {
|
||||
Log::info(
|
||||
app('log')->info(
|
||||
sprintf(
|
||||
'Today (%s) is not a magic day for %s auto-budget #%d (part of budget #%d "%s")',
|
||||
$this->date->format('Y-m-d'),
|
||||
@ -114,7 +114,7 @@ class CreateAutoBudgetLimits implements ShouldQueue
|
||||
|
||||
return;
|
||||
}
|
||||
Log::info(
|
||||
app('log')->info(
|
||||
sprintf(
|
||||
'Today (%s) is a magic day for %s auto-budget #%d (part of budget #%d "%s")',
|
||||
$this->date->format('Y-m-d'),
|
||||
@ -300,11 +300,11 @@ class CreateAutoBudgetLimits implements ShouldQueue
|
||||
Log::debug(sprintf('Total amount left for previous budget period is %s', $budgetLeft));
|
||||
|
||||
if (-1 !== bccomp('0', $budgetLeft)) {
|
||||
Log::info(sprintf('The amount left is negative, so it will be reset to %s.', $totalAmount));
|
||||
app('log')->info(sprintf('The amount left is negative, so it will be reset to %s.', $totalAmount));
|
||||
}
|
||||
if (1 !== bccomp('0', $budgetLeft)) {
|
||||
$totalAmount = bcadd($budgetLeft, $totalAmount);
|
||||
Log::info(sprintf('The amount left is positive, so the new amount will be %s.', $totalAmount));
|
||||
app('log')->info(sprintf('The amount left is positive, so the new amount will be %s.', $totalAmount));
|
||||
}
|
||||
|
||||
// create budget limit:
|
||||
@ -366,17 +366,17 @@ class CreateAutoBudgetLimits implements ShouldQueue
|
||||
|
||||
|
||||
if (-1 !== bccomp($budgetAvailable, $totalAmount)) {
|
||||
Log::info(sprintf('There is no overspending, no need to adjust. Budget limit amount will be %s.', $budgetAvailable));
|
||||
app('log')->info(sprintf('There is no overspending, no need to adjust. Budget limit amount will be %s.', $budgetAvailable));
|
||||
// create budget limit:
|
||||
$this->createBudgetLimit($autoBudget, $start, $end, $budgetAvailable);
|
||||
}
|
||||
if (1 !== bccomp($budgetAvailable, $totalAmount) && 1 === bccomp($budgetAvailable, '0')) {
|
||||
Log::info(sprintf('There was overspending, so the new amount will be %s.', $budgetAvailable));
|
||||
app('log')->info(sprintf('There was overspending, so the new amount will be %s.', $budgetAvailable));
|
||||
// create budget limit:
|
||||
$this->createBudgetLimit($autoBudget, $start, $end, $budgetAvailable);
|
||||
}
|
||||
if (1 !== bccomp($budgetAvailable, $totalAmount) && -1 === bccomp($budgetAvailable, '0')) {
|
||||
Log::info('There was overspending, but so much even this period cant fix that. Reset it to 1.');
|
||||
app('log')->info('There was overspending, but so much even this period cant fix that. Reset it to 1.');
|
||||
// create budget limit:
|
||||
$this->createBudgetLimit($autoBudget, $start, $end, '1');
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ class CreateRecurringTransactions implements ShouldQueue
|
||||
Log::debug(sprintf('Now filtering recurrence #%d, owned by user #%d', $recurrence->id, $recurrence->user_id));
|
||||
// is not active.
|
||||
if (!$this->active($recurrence)) {
|
||||
Log::info(sprintf('Recurrence #%d is not active. Skipped.', $recurrence->id));
|
||||
app('log')->info(sprintf('Recurrence #%d is not active. Skipped.', $recurrence->id));
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -194,14 +194,14 @@ class CreateRecurringTransactions implements ShouldQueue
|
||||
// has repeated X times.
|
||||
$journalCount = $this->repository->getJournalCount($recurrence);
|
||||
if (0 !== $recurrence->repetitions && $journalCount >= $recurrence->repetitions && false === $this->force) {
|
||||
Log::info(sprintf('Recurrence #%d has run %d times, so will run no longer.', $recurrence->id, $recurrence->repetitions));
|
||||
app('log')->info(sprintf('Recurrence #%d has run %d times, so will run no longer.', $recurrence->id, $recurrence->repetitions));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// is no longer running
|
||||
if ($this->repeatUntilHasPassed($recurrence)) {
|
||||
Log::info(
|
||||
app('log')->info(
|
||||
sprintf(
|
||||
'Recurrence #%d was set to run until %s, and today\'s date is %s. Skipped.',
|
||||
$recurrence->id,
|
||||
@ -215,7 +215,7 @@ class CreateRecurringTransactions implements ShouldQueue
|
||||
|
||||
// first_date is in the future
|
||||
if ($this->hasNotStartedYet($recurrence)) {
|
||||
Log::info(
|
||||
app('log')->info(
|
||||
sprintf(
|
||||
'Recurrence #%d is set to run on %s, and today\'s date is %s. Skipped.',
|
||||
$recurrence->id,
|
||||
@ -229,7 +229,7 @@ class CreateRecurringTransactions implements ShouldQueue
|
||||
|
||||
// already fired today (with success):
|
||||
if (false === $this->force && $this->hasFiredToday($recurrence)) {
|
||||
Log::info(sprintf('Recurrence #%d has already fired today. Skipped.', $recurrence->id));
|
||||
app('log')->info(sprintf('Recurrence #%d has already fired today. Skipped.', $recurrence->id));
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -391,13 +391,13 @@ class CreateRecurringTransactions implements ShouldQueue
|
||||
// count created journals on THIS day.
|
||||
$journalCount = $this->repository->getJournalCount($recurrence, $date, $date);
|
||||
if ($journalCount > 0 && false === $this->force) {
|
||||
Log::info(sprintf('Already created %d journal(s) for date %s', $journalCount, $date->format('Y-m-d')));
|
||||
app('log')->info(sprintf('Already created %d journal(s) for date %s', $journalCount, $date->format('Y-m-d')));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($this->repository->createdPreviously($recurrence, $date) && false === $this->force) {
|
||||
Log::info('There is a transaction already made for this date, so will not be created now');
|
||||
app('log')->info('There is a transaction already made for this date, so will not be created now');
|
||||
|
||||
return null;
|
||||
}
|
||||
@ -431,7 +431,7 @@ class CreateRecurringTransactions implements ShouldQueue
|
||||
/** @var TransactionGroup $group */
|
||||
$group = $this->groupRepository->store($array);
|
||||
$this->created++;
|
||||
Log::info(sprintf('Created new transaction group #%d', $group->id));
|
||||
app('log')->info(sprintf('Created new transaction group #%d', $group->id));
|
||||
|
||||
// trigger event:
|
||||
event(new StoredTransactionGroup($group, $recurrence->apply_rules, true));
|
||||
|
@ -155,7 +155,7 @@ class UserRepository implements UserRepositoryInterface
|
||||
foreach ($groups as $group) {
|
||||
$count = $group->groupMemberships()->count();
|
||||
if (0 === $count) {
|
||||
Log::info(sprintf('Deleted empty group #%d ("%s")', $group->id, $group->title));
|
||||
app('log')->info(sprintf('Deleted empty group #%d ("%s")', $group->id, $group->title));
|
||||
$group->delete();
|
||||
}
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ class UpdateRequest implements UpdateRequestInterface
|
||||
$return['version'] = $response['version'];
|
||||
$return['level'] = 'success';
|
||||
$return['date'] = Carbon::createFromFormat('Y-m-d', $response['date'])->startOfDay();
|
||||
Log::info('Response from update server', $response);
|
||||
app('log')->info('Response from update server', $response);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ trait AccountServiceTrait
|
||||
$rules = ['iban' => 'required|iban'];
|
||||
$validator = Validator::make($data, $rules);
|
||||
if ($validator->fails()) {
|
||||
Log::info(sprintf('Detected invalid IBAN ("%s"). Return NULL instead.', $iban));
|
||||
app('log')->info(sprintf('Detected invalid IBAN ("%s"). Return NULL instead.', $iban));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ class JournalUpdateService
|
||||
|
||||
// can we update account data using the new type?
|
||||
if ($this->hasValidAccounts()) {
|
||||
Log::info('Account info is valid, now update.');
|
||||
app('log')->info('Account info is valid, now update.');
|
||||
// update accounts:
|
||||
$this->updateAccounts();
|
||||
|
||||
@ -805,7 +805,7 @@ class JournalUpdateService
|
||||
$dest->save();
|
||||
Log::debug(sprintf('Foreign amount is "%s" so remove foreign amount info.', $amount));
|
||||
}
|
||||
Log::info('Not enough info to update foreign currency info.');
|
||||
app('log')->info('Not enough info to update foreign currency info.');
|
||||
|
||||
// refresh transactions.
|
||||
$this->sourceTransaction->refresh();
|
||||
|
@ -55,7 +55,7 @@ class CLIToken implements BinderInterface
|
||||
foreach ($users as $user) {
|
||||
$accessToken = app('preferences')->getForUser($user, 'access_token');
|
||||
if (null !== $accessToken && $accessToken->data === $value) {
|
||||
Log::info(sprintf('Recognized user #%d (%s) from his acccess token.', $user->id, $user->email));
|
||||
app('log')->info(sprintf('Recognized user #%d (%s) from his acccess token.', $user->id, $user->email));
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
@ -45,13 +45,13 @@ class AutoBudgetCronjob extends AbstractCronjob
|
||||
$diff = time() - $lastTime;
|
||||
$diffForHumans = today(config('app.timezone'))->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
if (0 === $lastTime) {
|
||||
Log::info('Auto budget cron-job has never fired before.');
|
||||
app('log')->info('Auto budget cron-job has never fired before.');
|
||||
}
|
||||
// less than half a day ago:
|
||||
if ($lastTime > 0 && $diff <= 43200) {
|
||||
Log::info(sprintf('It has been %s since the auto budget cron-job has fired.', $diffForHumans));
|
||||
app('log')->info(sprintf('It has been %s since the auto budget cron-job has fired.', $diffForHumans));
|
||||
if (false === $this->force) {
|
||||
Log::info('The auto budget cron-job will not fire now.');
|
||||
app('log')->info('The auto budget cron-job will not fire now.');
|
||||
$this->message = sprintf('It has been %s since the auto budget cron-job has fired. It will not fire now.', $diffForHumans);
|
||||
|
||||
return;
|
||||
@ -59,12 +59,12 @@ class AutoBudgetCronjob extends AbstractCronjob
|
||||
|
||||
// fire job regardless.
|
||||
if (true === $this->force) {
|
||||
Log::info('Execution of the auto budget cron-job has been FORCED.');
|
||||
app('log')->info('Execution of the auto budget cron-job has been FORCED.');
|
||||
}
|
||||
}
|
||||
|
||||
if ($lastTime > 0 && $diff > 43200) {
|
||||
Log::info(sprintf('It has been %s since the auto budget cron-job has fired. It will fire now!', $diffForHumans));
|
||||
app('log')->info(sprintf('It has been %s since the auto budget cron-job has fired. It will fire now!', $diffForHumans));
|
||||
}
|
||||
|
||||
$this->fireAutoBudget();
|
||||
@ -76,7 +76,7 @@ class AutoBudgetCronjob extends AbstractCronjob
|
||||
*/
|
||||
private function fireAutoBudget(): void
|
||||
{
|
||||
Log::info(sprintf('Will now fire auto budget cron job task for date "%s".', $this->date->format('Y-m-d')));
|
||||
app('log')->info(sprintf('Will now fire auto budget cron job task for date "%s".', $this->date->format('Y-m-d')));
|
||||
/** @var CreateAutoBudgetLimits $job */
|
||||
$job = app(CreateAutoBudgetLimits::class, [$this->date]);
|
||||
$job->setDate($this->date);
|
||||
@ -89,6 +89,6 @@ class AutoBudgetCronjob extends AbstractCronjob
|
||||
$this->message = 'Auto-budget cron job fired successfully.';
|
||||
|
||||
app('fireflyconfig')->set('last_ab_job', (int)$this->date->format('U'));
|
||||
Log::info('Done with auto budget cron job task.');
|
||||
app('log')->info('Done with auto budget cron job task.');
|
||||
}
|
||||
}
|
||||
|
@ -51,13 +51,13 @@ class BillWarningCronjob extends AbstractCronjob
|
||||
$diffForHumans = today(config('app.timezone'))->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
|
||||
if (0 === $lastTime) {
|
||||
Log::info('The bill warning cron-job has never fired before.');
|
||||
app('log')->info('The bill warning cron-job has never fired before.');
|
||||
}
|
||||
// less than half a day ago:
|
||||
if ($lastTime > 0 && $diff <= 43200) {
|
||||
Log::info(sprintf('It has been %s since the bill warning cron-job has fired.', $diffForHumans));
|
||||
app('log')->info(sprintf('It has been %s since the bill warning cron-job has fired.', $diffForHumans));
|
||||
if (false === $this->force) {
|
||||
Log::info('The cron-job will not fire now.');
|
||||
app('log')->info('The cron-job will not fire now.');
|
||||
$this->message = sprintf('It has been %s since the bill warning cron-job has fired. It will not fire now.', $diffForHumans);
|
||||
$this->jobFired = false;
|
||||
$this->jobErrored = false;
|
||||
@ -68,12 +68,12 @@ class BillWarningCronjob extends AbstractCronjob
|
||||
|
||||
// fire job regardless.
|
||||
if (true === $this->force) {
|
||||
Log::info('Execution of the bill warning cron-job has been FORCED.');
|
||||
app('log')->info('Execution of the bill warning cron-job has been FORCED.');
|
||||
}
|
||||
}
|
||||
|
||||
if ($lastTime > 0 && $diff > 43200) {
|
||||
Log::info(sprintf('It has been %s since the bill warning cron-job has fired. It will fire now!', $diffForHumans));
|
||||
app('log')->info(sprintf('It has been %s since the bill warning cron-job has fired. It will fire now!', $diffForHumans));
|
||||
}
|
||||
|
||||
$this->fireWarnings();
|
||||
@ -86,7 +86,7 @@ class BillWarningCronjob extends AbstractCronjob
|
||||
*/
|
||||
private function fireWarnings(): void
|
||||
{
|
||||
Log::info(sprintf('Will now fire bill warning job task for date "%s".', $this->date->format('Y-m-d H:i:s')));
|
||||
app('log')->info(sprintf('Will now fire bill warning job task for date "%s".', $this->date->format('Y-m-d H:i:s')));
|
||||
/** @var WarnAboutBills $job */
|
||||
$job = app(WarnAboutBills::class);
|
||||
$job->setDate($this->date);
|
||||
@ -100,7 +100,7 @@ class BillWarningCronjob extends AbstractCronjob
|
||||
$this->message = 'Bill warning cron job fired successfully.';
|
||||
|
||||
app('fireflyconfig')->set('last_bw_job', (int)$this->date->format('U'));
|
||||
Log::info(sprintf('Marked the last time this job has run as "%s" (%d)', $this->date->format('Y-m-d H:i:s'), (int)$this->date->format('U')));
|
||||
Log::info('Done with bill warning cron job task.');
|
||||
app('log')->info(sprintf('Marked the last time this job has run as "%s" (%d)', $this->date->format('Y-m-d H:i:s'), (int)$this->date->format('U')));
|
||||
app('log')->info('Done with bill warning cron job task.');
|
||||
}
|
||||
}
|
||||
|
@ -45,13 +45,13 @@ class ExchangeRatesCronjob extends AbstractCronjob
|
||||
$diff = time() - $lastTime;
|
||||
$diffForHumans = today(config('app.timezone'))->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
if (0 === $lastTime) {
|
||||
Log::info('Exchange rates cron-job has never fired before.');
|
||||
app('log')->info('Exchange rates cron-job has never fired before.');
|
||||
}
|
||||
// less than half a day ago:
|
||||
if ($lastTime > 0 && $diff <= 43200) {
|
||||
Log::info(sprintf('It has been %s since the exchange rates cron-job has fired.', $diffForHumans));
|
||||
app('log')->info(sprintf('It has been %s since the exchange rates cron-job has fired.', $diffForHumans));
|
||||
if (false === $this->force) {
|
||||
Log::info('The exchange rates cron-job will not fire now.');
|
||||
app('log')->info('The exchange rates cron-job will not fire now.');
|
||||
$this->message = sprintf('It has been %s since the exchange rates cron-job has fired. It will not fire now.', $diffForHumans);
|
||||
|
||||
return;
|
||||
@ -59,12 +59,12 @@ class ExchangeRatesCronjob extends AbstractCronjob
|
||||
|
||||
// fire job regardless.
|
||||
if (true === $this->force) {
|
||||
Log::info('Execution of the exchange rates cron-job has been FORCED.');
|
||||
app('log')->info('Execution of the exchange rates cron-job has been FORCED.');
|
||||
}
|
||||
}
|
||||
|
||||
if ($lastTime > 0 && $diff > 43200) {
|
||||
Log::info(sprintf('It has been %s since the exchange rates cron-job has fired. It will fire now!', $diffForHumans));
|
||||
app('log')->info(sprintf('It has been %s since the exchange rates cron-job has fired. It will fire now!', $diffForHumans));
|
||||
}
|
||||
|
||||
$this->fireExchangeRateJob();
|
||||
@ -76,7 +76,7 @@ class ExchangeRatesCronjob extends AbstractCronjob
|
||||
*/
|
||||
private function fireExchangeRateJob(): void
|
||||
{
|
||||
Log::info(sprintf('Will now fire exchange rates cron job task for date "%s".', $this->date->format('Y-m-d')));
|
||||
app('log')->info(sprintf('Will now fire exchange rates cron job task for date "%s".', $this->date->format('Y-m-d')));
|
||||
/** @var DownloadExchangeRates $job */
|
||||
$job = app(DownloadExchangeRates::class);
|
||||
$job->setDate($this->date);
|
||||
@ -89,6 +89,6 @@ class ExchangeRatesCronjob extends AbstractCronjob
|
||||
$this->message = 'Exchange rates cron job fired successfully.';
|
||||
|
||||
app('fireflyconfig')->set('last_cer_job', (int)$this->date->format('U'));
|
||||
Log::info('Done with exchange rates job task.');
|
||||
app('log')->info('Done with exchange rates job task.');
|
||||
}
|
||||
}
|
||||
|
@ -51,13 +51,13 @@ class RecurringCronjob extends AbstractCronjob
|
||||
$diffForHumans = today(config('app.timezone'))->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
|
||||
if (0 === $lastTime) {
|
||||
Log::info('Recurring transactions cron-job has never fired before.');
|
||||
app('log')->info('Recurring transactions cron-job has never fired before.');
|
||||
}
|
||||
// less than half a day ago:
|
||||
if ($lastTime > 0 && $diff <= 43200) {
|
||||
Log::info(sprintf('It has been %s since the recurring transactions cron-job has fired.', $diffForHumans));
|
||||
app('log')->info(sprintf('It has been %s since the recurring transactions cron-job has fired.', $diffForHumans));
|
||||
if (false === $this->force) {
|
||||
Log::info('The cron-job will not fire now.');
|
||||
app('log')->info('The cron-job will not fire now.');
|
||||
$this->message = sprintf('It has been %s since the recurring transactions cron-job has fired. It will not fire now.', $diffForHumans);
|
||||
$this->jobFired = false;
|
||||
$this->jobErrored = false;
|
||||
@ -68,12 +68,12 @@ class RecurringCronjob extends AbstractCronjob
|
||||
|
||||
// fire job regardless.
|
||||
if (true === $this->force) {
|
||||
Log::info('Execution of the recurring transaction cron-job has been FORCED.');
|
||||
app('log')->info('Execution of the recurring transaction cron-job has been FORCED.');
|
||||
}
|
||||
}
|
||||
|
||||
if ($lastTime > 0 && $diff > 43200) {
|
||||
Log::info(sprintf('It has been %s since the recurring transactions cron-job has fired. It will fire now!', $diffForHumans));
|
||||
app('log')->info(sprintf('It has been %s since the recurring transactions cron-job has fired. It will fire now!', $diffForHumans));
|
||||
}
|
||||
|
||||
$this->fireRecurring();
|
||||
@ -86,7 +86,7 @@ class RecurringCronjob extends AbstractCronjob
|
||||
*/
|
||||
private function fireRecurring(): void
|
||||
{
|
||||
Log::info(sprintf('Will now fire recurring cron job task for date "%s".', $this->date->format('Y-m-d H:i:s')));
|
||||
app('log')->info(sprintf('Will now fire recurring cron job task for date "%s".', $this->date->format('Y-m-d H:i:s')));
|
||||
/** @var CreateRecurringTransactions $job */
|
||||
$job = app(CreateRecurringTransactions::class);
|
||||
$job->setDate($this->date);
|
||||
@ -100,7 +100,7 @@ class RecurringCronjob extends AbstractCronjob
|
||||
$this->message = 'Recurring transactions cron job fired successfully.';
|
||||
|
||||
app('fireflyconfig')->set('last_rt_job', (int)$this->date->format('U'));
|
||||
Log::info(sprintf('Marked the last time this job has run as "%s" (%d)', $this->date->format('Y-m-d H:i:s'), (int)$this->date->format('U')));
|
||||
Log::info('Done with recurring cron job task.');
|
||||
app('log')->info(sprintf('Marked the last time this job has run as "%s" (%d)', $this->date->format('Y-m-d H:i:s'), (int)$this->date->format('U')));
|
||||
app('log')->info('Done with recurring cron job task.');
|
||||
}
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
throw new FireflyException(sprintf('Unsupported search operator: "%s"', $operator));
|
||||
// some search operators are ignored, basically:
|
||||
case 'user_action':
|
||||
Log::info(sprintf('Ignore search operator "%s"', $operator));
|
||||
app('log')->info(sprintf('Ignore search operator "%s"', $operator));
|
||||
|
||||
return false;
|
||||
//
|
||||
@ -863,7 +863,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
}
|
||||
// no tags found means search must result in nothing.
|
||||
if (null === $result) {
|
||||
Log::info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator));
|
||||
app('log')->info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator));
|
||||
$this->collector->findNothing();
|
||||
}
|
||||
break;
|
||||
|
@ -41,7 +41,7 @@ trait GeneratesInstallationId
|
||||
try {
|
||||
$config = app('fireflyconfig')->get('installation_id');
|
||||
} catch (FireflyException $e) {
|
||||
Log::info('Could not create or generate installation ID. Do not continue.');
|
||||
app('log')->info('Could not create or generate installation ID. Do not continue.');
|
||||
|
||||
return;
|
||||
}
|
||||
@ -54,7 +54,7 @@ trait GeneratesInstallationId
|
||||
if (null === $config) {
|
||||
$uuid4 = Uuid::uuid4();
|
||||
$uniqueId = (string)$uuid4;
|
||||
Log::info(sprintf('Created Firefly III installation ID %s', $uniqueId));
|
||||
app('log')->info(sprintf('Created Firefly III installation ID %s', $uniqueId));
|
||||
app('fireflyconfig')->set('installation_id', $uniqueId);
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ class UpdatePiggybank implements ActionInterface
|
||||
|
||||
$piggyBank = $this->findPiggyBank($user);
|
||||
if (null === $piggyBank) {
|
||||
Log::info(
|
||||
app('log')->info(
|
||||
sprintf('No piggy bank named "%s", cant execute action #%d of rule #%d', $this->action->action_value, $this->action->id, $this->action->rule_id)
|
||||
);
|
||||
event(new RuleActionFailedOnArray($this->action, $journal, trans('rules.cannot_find_piggy', ['name' => $this->action->action_value])));
|
||||
@ -123,7 +123,7 @@ class UpdatePiggybank implements ActionInterface
|
||||
|
||||
return true;
|
||||
}
|
||||
Log::info(
|
||||
app('log')->info(
|
||||
sprintf(
|
||||
'Piggy bank is not linked to source ("#%d") or destination ("#%d"), so no action will be taken.',
|
||||
$source->account_id,
|
||||
|
Loading…
Reference in New Issue
Block a user