Error on image attachment on Extent report

Hi,

I am able to capture images and attached it to the extent report at the end of test. But I am getting an error as below,
groovy.lang.MissingMethodException: No signature of method: com.aventstack.extentreports.ExtentTest.log() is applicable for argument types: (com.aventstack.extentreports.Status, com.aventstack.extentreports.ExtentTest) values: [fail, com.aventstack.extentreports.ExtentTest@762637be]
Possible solutions: log(com.aventstack.extentreports.Status, com.aventstack.extentreports.markuputils.Markup), log(com.aventstack.extentreports.Status, java.lang.String), log(com.aventstack.extentreports.Status, java.lang.Throwable),

Could someone help me on this.

Thanks,
Thushar