Convert a BOOLEAN test into a STRING

I want to store a boolean test in a local variable in order to reuse it in different parts of the rule.
And I want to display in the log the result of a boolean test.

val check_pH = (neMB_pHvalue.state as DecimalType) > 8.5 || (neMB_pHvalue.state as DecimalType) < 6

I got the following error message:

2022-07-22 10:22:43.776 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'poolSchedule-8' failed: An error occurred during the script execution: Could not invoke method: org.openhab.core.model.script.actions.Log.logInfo(java.lang.String,java.lang.String,java.lang.Object[]) on instance: null in poolSchedule

How can I achieve this?

The logInfo wants two strings; you’d want something like


but I can’t remember if the boolean has a .toString method.
If not, try

logInfo("pH-test1", "my variable {}", check_pH)

Both proposed solutions work!
Thanks a lot!