I want to add logging which need some more expensive operations before. Let's say I want to retrieve extra entities, count them or other things and use this information in the log action. I log this at debug level. If the lognode is higher than debug, there is no need to do all this extra operations, since it is only used in the logaction itself. In Java you could use the isLoggable() method from the log api for this, are there any solutions for this in Mendix?
I feel like this should be a java action in CommunityCommons. It could be something like this:
Given an input "LogNode", it should return an enum with the max current log level of all log subscribers (since there can be more than 1).