Logger name and lambdas: store name in a variable to avoid redundancy?

Hi there!

I’ve come across some minor flaw when working with lambdas:

I like to use logging to make sure my code works / for debugging purposes. When adding logging I’ve to repeat the name of the logger again and again. Storing that name in a final variable still does not make it available to lambdas. The only way I found so far is a logger-name parameter for the lambda.

Are there any alternatives?

Best regards,
cd_

No, that has your only option. Glabal vars and Val’s are not visible to each other. Since a lambda is a global val, it can’t see other globals, including your logger name or other lambdas for that matter. They must be passed in as arguments.

Ok, thanks for the feedback!

Are there any plans on changing this? Or is this just intention in order not to let rules become to large?

There is no movement to change this as far as I’m aware. I think it is a limitation of the language parser and not something that can be fixed without major and risky changes to the Rules language itself. And since most of the experts in this area are mainly focused on the Experimental Rules Engine I don’t know how many people have the expertise to make such a fundamental change as this anymore.

Ok, thank you for the insights! :slight_smile: