Add debug logging

This commit is contained in:
James Cole 2024-03-10 08:07:47 +01:00
parent 67b16cc070
commit 5718d1690a
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80

View File

@ -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