This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 228308 - "log..." java code templates should add logger if not present
Summary: "log..." java code templates should add logger if not present
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 7.4
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Dusan Balek
Depends on: 252708
  Show dependency tree
Reported: 2013-04-05 21:55 UTC by athompson
Modified: 2016-07-07 16:03 UTC (History)
2 users (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description athompson 2013-04-05 21:55:08 UTC
This may not be doable with the current template system, but I'll ask anyway. It would be nice if when using the logging code templates to add a log message to a java file (which requires a static logger), a static logger is automatically added if not present. The static logger should be added using the defined "logr" or "logbr" templates as appropriate, and the IDE's formatting rules could be used for determining where in the code the static logger is inserted.

This would likely require two template system enhancements, which could open the door to far more powerful (and often simpler) templates--the ability to call another template from the current template, and the ability to branch based on a condition (in this case acting only if a static logger is not yet present).
Comment 1 Martin Balin 2016-07-07 07:27:42 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss
Comment 2 athompson 2016-07-07 16:03:12 UTC
I still like this idea.  :P