There are times when working with Griffon you'd like to know what's really happening during build process execution; for example, how much time does it take for a task to complete, or what are the different events you can react to using build event handlers.
There are two ways to know this. The first and easiest one is to define a value for the griffon.cli.verbose flag. This flag can be either set in the command line or written down in one of the two buildtime configuration files ($appHome/griffon-app/conf/BuildConfig.groovy or $USER_HOME/.griffon/settings.groovy). Take for example the invocation of the clean command right after a compilation step has been issued.
Now compare that to the output generated when the griffon.cli.verbose flag is enabled
Much different now. The first debug row tells us exactly which targets will be executed before the default one (defined by the Clean command) is called. For each target we can see when it began and finished, in milliseconds. What about the event name? Well it's a simple matter of capitalizing the target name and appending either Start or End, meaning that if you want to react to when the packaging has been cleaned then you must place an event handler named eventClearPackagingEnd on your event handler script (scripts/_Events.groovy). Bear in mind that the value specified at the command line for this flag will override any value set in the config files.
The second approach is to tweak the logging configuration available at buildtime. For this we'll need to edit $appName/griffon-app/conf/BuildConfig.groovy. Right at the end we'll find the default logging configuration in the form of a Log4j DSL. Modify it so that the package org.codehaus.griffon is set to trace, like this
Calling the clean command again after a compilation has been executed yields the following output
Now we can appreciate exactly the event names that the build will trigger. Notice that custom event handlers are registered during the execution of the loadEventHooks target, which means you can't react to events triggered prior to LoadEventHooksEnd.
Keep on Groovying!