Results 1 to 9 of 9
  1. #1
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default wrapper all methods debug's info

    Hi all. I need some advice about follow task.
    I need wrap all methods in a project debug information like that.
    source method
    Java Code:
     
    public void echo() {
    //
    }
    wrapper method
    Java Code:
    public void echo() {
    log.debug("start  : " + nameMethod);
    //
    log.debug("finish  : " + nameMethod + " time : " + time);
    }
    Any advice will be appreciated.
    Skype: petrarsentev
    http://TrackStudio.com

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,415
    Rep Power
    25

    Default

    I need wrap all methods in a project debug information like that.
    Are you looking to write a program to scan java source code and insert source statements for the two log.debug() method calls?

  3. #3
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default

    Yes. But I must be able to turn it off when I get this task. I know that it can make aspectJ, but I don't have any practice with it.
    Last edited by Petr; 08-02-2011 at 04:19 PM.
    Skype: petrarsentev
    http://TrackStudio.com

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,415
    Rep Power
    25

    Default

    If the methods are in the same class make add an if(doLog) log....
    Set doLog = false to turn the log off.

  5. #5
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default

    Oh I think it is not so good solve. This project has more 1000 classes. If I do it I will be to do much hand job.
    Skype: petrarsentev
    http://TrackStudio.com

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default

    Why?
    What is the purpose of this?

  7. #7
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,415
    Rep Power
    25

    Default

    Are you looking to write a program to scan java source code and insert source statements for the two log.debug() method calls?

  8. #8
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default

    I'm looking something like that Perf4J 0.9.13 - Developer Guide
    Skype: petrarsentev
    http://TrackStudio.com

  9. #9
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default

    I still don't see what advantage you get from timing everything in your system.
    Key parts yes, but every method?

Similar Threads

  1. Debug challenge: how do you debug a Java program?
    By CJSLMAN in forum New To Java
    Replies: 60
    Last Post: 07-04-2009, 10:28 AM
  2. Wrapper objects
    By Ash-infinity in forum New To Java
    Replies: 4
    Last Post: 12-14-2008, 08:48 PM
  3. Wrapper Class
    By haiforhussain in forum New To Java
    Replies: 6
    Last Post: 06-24-2008, 08:08 AM
  4. Secure FTP Wrapper 3.0.2
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 04-29-2008, 06:05 PM
  5. wrapper classes
    By sireesha in forum New To Java
    Replies: 5
    Last Post: 12-11-2007, 09:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •