Ability to log from reports (yarg) groovy script

Hi,

Just curious about how can I log from the groovy script used in the dataset of report bands. If not possible, that will be a great to have feature.

Currently for any value related issues in the script I have to do guessing and fixing as I am not sure how to log. Same is missing in documentation as well.

Thanks

Use com.haulmont.cuba.core.global.AppBeans to obtain org.slf4j.Logger in your scripts. Also you can get Logger using its factory methods.

Hey,
Just a note. If you speaking just about debugging while developing report print works fine too.
In longterm it is good practice to use Logger as Ilia said.

No, you don’t need AppBeans to get Logger.

Just use the standard SLF4J factory in Groovy band:

import org.slf4j.LoggerFactory;

def logger = LoggerFactory.getLogger('[Report - Demo]');

logger.info('Loading data');

return [[:]]

Yes, you are quite right. I meant LoggerFactory's factory methods, not Logger's ones.