mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-01 04:59:25 -06:00
Add debug logging
This commit is contained in:
parent
67b16cc070
commit
5718d1690a
@ -31,6 +31,7 @@ use Illuminate\Database\Eloquent\Builder;
|
|||||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
use Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FireflyIII\Models\RuleAction
|
* FireflyIII\Models\RuleAction
|
||||||
@ -79,11 +80,13 @@ class RuleAction extends Model
|
|||||||
public function getValue(array $journal): string
|
public function getValue(array $journal): string
|
||||||
{
|
{
|
||||||
if (false === config('firefly.feature_flags.expression_engine')) {
|
if (false === config('firefly.feature_flags.expression_engine')) {
|
||||||
|
Log::debug('Expression engine is disabled, returning action value as string.');
|
||||||
return (string)$this->action_value;
|
return (string)$this->action_value;
|
||||||
}
|
}
|
||||||
$expr = new ActionExpression($this->action_value);
|
$expr = new ActionExpression($this->action_value);
|
||||||
|
$result = $expr->evaluate($journal);
|
||||||
return $expr->evaluate($journal);
|
Log::debug(sprintf('Expression engine is enabled, result of expression "%s" is "%s".', $this->action_value, $result));
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function rule(): BelongsTo
|
public function rule(): BelongsTo
|
||||||
|
Loading…
Reference in New Issue
Block a user