To keep an overview of the messages printed, I usually preceed every message with currentClass.currentMethod. In JDeveloper, there's an easy way to do this:
- Open Tools -> Preferences...
- Go to Code Editor -> Code Templates
- Add a new one
- Enter a shortcut (I use 'sopl'), and change the context to Java
- In the code section, type System.out.println("$myCurClass$.$myCurMethod$(): $end$");
- In the variables tab, map myCurClass to 'Class Name' and myCurMethod to 'Method Name'
- Leave end mapped to 'End Location'
Now you can use sopl in every Java class! Just type sopl and hit Ctrl+Enter.
No comments:
Post a Comment