About a month ago I tweeted out “How do you debug in Groovy and Grails?” Someone had asked me privately, and I have to say I can’t recall who it was. Can’t find the tweet or email, whatever it was. Whoever asked – I apologize for not having got back to you.
Here were the answers I got back on from Twitter.
-
keithcochran: @groovymag I use IntelliJ and start the server in debug mode. It works well but some classes (like services) I have to use log.debug()
-
dani_latorre: @groovymag : grails-debug run-app + eclipse breakpoints
-
colinharrington: @groovymag intellij is the only one that I have been able to debug in. Eclipse worked up until you had plugins or joint compilation
-
AndreasArledal: @groovymag So far just using println has worked well. I’m considering moving from textmate to Idea, if I do I’ll probably use grails-debug.
-
graemerocher: @groovymag println for simple stuff. Intellij + grails-debug run-app for anything more complex
-
burtbeckwith: @groovymag I usually run with “grails-debug run-app” and attach the Eclipse debugger as needed

















Who need to debug when testing ?
You’re assuming that they’re 2 different things. In some cases they are, but not all. Writing tests just tests that the output is correct – you may still need to work step by step through the code that you’re testing. Debugging IDEs help that.