Reports log statements with non-constant arguments which are not surrounded by a guard condition. The evaluation of the arguments of a log statement can be expensive. Surrounding a log statement with a guard clause prevents that cost when the logging is disabled for the level used by the logging statement. This is especially for the least serious level (trace, debug, finest) of logging statements, because those are most often disabled in a production environment.

Use the text field below to specify the logger class name used.

Use the table to specify the log methods this inspection should warn on, with the corresponding logging condition text.

Use the checkbox below to let this inspection flag all unguarded log statements, not only those with non-constant arguments.

New in 8, Powered by InspectionGadgets