| Logger Insertions |
OverviewYou can either insert logger statements for the whole class, for a certain method, for a certain variable or at a certain position. These tasks are described in the following subsections. In the preference page Log4E > User Interaction, you can specify if a certain task should invoke the Preview Wizard. The Preview Wizard shows all differences to the original source code to give you the chance to check where and how logger statements will be created. The modified source can be edited during that process [Pro version only]. If more than one file has been selected you can browse them all in the same wizard and commit the changes at once [Pro version only]. See screenshots on class, position and variable scope for a quick overview. Insertions for method/classTwo operations are executed:
Most of the documentation is already done in the Preferences:Positions and Preferences:Statements. Example: Before: public String myMethod(String theString, int theInt) { After: public String myMethod(String theString, int theInt) { Note that Log4E checks if "returnString" already exists and appends a number. e.g. if "returnString" exists the new variable would be "returnString2" (and so on).
Insert at certain positionPlace the textcursor at a valid position within a method and invoke the submenu "Log4E->Insert Log Statement At This Position...". A Wizard pops up as shown below. Wizard settings:
There's a preview afterwards:
Insertions for selected variableThis is an often requested "fast logging feature". It will generate a logger statement immediately without any further interaction. Select any variable within a variable declaration, a variable assignment or a method or place the textcursor below a variable declaration and choose "Log this variable" from the Log4E context menu. |