Improve logging [skip ci]

This commit is contained in:
James Cole 2018-04-14 23:12:54 +02:00
parent f4afcb4d50
commit 38b1fc7aa6
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
3 changed files with 6 additions and 6 deletions

View File

@ -75,11 +75,11 @@ final class AmountExactly extends AbstractTrigger implements TriggerInterface
$compare = $this->triggerValue;
$result = bccomp($amount, $compare);
if (0 === $result) {
Log::debug(sprintf('RuleTrigger AmountExactly for journal #%d: %d matches %d exactly, so return true', $journal->id, $amount, $compare));
Log::debug(sprintf('RuleTrigger AmountExactly for journal #%d: %f matches %f exactly, so return true', $journal->id, $amount, $compare));
return true;
}
Log::debug(sprintf('RuleTrigger AmountExactly for journal #%d: %d matches %d NOT exactly, so return false', $journal->id, $amount, $compare));
Log::debug(sprintf('RuleTrigger AmountExactly for journal #%d: %f matches %f NOT exactly, so return false', $journal->id, $amount, $compare));
return false;
}

View File

@ -74,12 +74,12 @@ final class AmountLess extends AbstractTrigger implements TriggerInterface
$compare = $this->triggerValue;
$result = bccomp($amount, $compare);
if ($result === -1) {
Log::debug(sprintf('RuleTrigger AmountLess for journal #%d: %d is less than %d, so return true', $journal->id, $amount, $compare));
Log::debug(sprintf('RuleTrigger AmountLess for journal #%d: %f is less than %f, so return true', $journal->id, $amount, $compare));
return true;
}
Log::debug(sprintf('RuleTrigger AmountLess for journal #%d: %d is NOT less than %d, so return false', $journal->id, $amount, $compare));
Log::debug(sprintf('RuleTrigger AmountLess for journal #%d: %f is NOT less than %f, so return false', $journal->id, $amount, $compare));
return false;
}

View File

@ -80,12 +80,12 @@ final class AmountMore extends AbstractTrigger implements TriggerInterface
$compare = $this->triggerValue;
$result = bccomp($amount, $compare);
if (1 === $result) {
Log::debug(sprintf('RuleTrigger AmountMore for journal #%d: %d is more than %d, so return true', $journal->id, $amount, $compare));
Log::debug(sprintf('RuleTrigger AmountMore for journal #%d: %f is more than %f, so return true', $journal->id, $amount, $compare));
return true;
}
Log::debug(sprintf('RuleTrigger AmountMore for journal #%d: %d is NOT more than %d, so return false', $journal->id, $amount, $compare));
Log::debug(sprintf('RuleTrigger AmountMore for journal #%d: %f is NOT more than %f, so return false', $journal->id, $amount, $compare));
return false;
}