Forum Discussion
- Please see Link below and let me know if this helps:
http://groovy.codehaus.org/Logging#Logging-SeeAlso
Regards,
Temil - SiKingCommunity ExpertAll you need is something like:
import com.eviware.soapui.SoapUI
def log = SoapUI.log
log.info "Hello world!"
log.warn "Goodbye world!" - paulieOccasional ContributorThanks SiKing but that prints in the SoaupUI log - I was hoping to print in the script log to keep all my logging together.
I tried the the instructions from the link but didn't get it working, any ideas? - Just try log.info "Hello World"
Regards,
Temil - paulieOccasional ContributorHi Temil, as I'm looking to do this from an external groovy class (in my scripts directory) I get the error
TestCase failed [groovy.lang.MissingPropertyException: No such property: log for class: Testing:groovy.lang.MissingPropertyException: No such property: log for class: Testing]
I don't have any imports in my groovy class - should there be?class Testing
{
public testPrint()
{
log.info "Testing out the print from the external class"
}
}
This is not vital, I can print to the SoapUI log, it just would have been nice to print to the script log to keep all my logging in one place.
Thanks - Try importing:
import groovy.util.logging.*
Regards,
Temil - paulieOccasional ContributorSolved this - I just needed to pass log into my groovy class constructor. I had tried variations of context when it was log I really needed. Thanks to all who replied.