Monday, September 20, 2010

@Log – Groovy’s New and Extensible Logging Conveniences

The latest version 1.8 snapshot of Groovy includes a cool new logging feature called @Log. The key of @Log and the other logging annotations is that the parameters sent to logging methods are not evaluated unless that specific log level is enabled. For instance, you can call Logger.debug with a long running closure as a parameter, and if the debug log level is not enabled then the parameter is never evaluated.


My full article on the Canoo blog shows the details, all the frameworks supported, and how to use your own logging framework with the feature: @Log – Groovy’s New and Extensible Logging Conveniences

No comments: