Results 1 to 8 of 8
  1. #1
    Krooger is offline Member
    Join Date
    Nov 2008
    Posts
    43
    Rep Power
    0

    Question Hiding Code? Is it possible?

    Hello, I want to implement my own type of debug option where a window opens and will just spit out variouse things that the program is doing as it does them. But the things i want to record are all over the place and I don't really want to have random debug lines all throughout my code. Does eclipse have a way to assign code to a group and then hide that group, or maybe assign certain code to be a seperate color? Anything to distinguish from my real code and just random stuff I rather not have visible.

    Thank you

  2. #2
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    Eclipse doesn't have anything like that to my knowledge but there are a couple of things you could try:

    Wrap debug code with if(debug) { ... }, with debug being taken from the command line parameters.

    Use java.util.logging to set up multiple levels of debug verbosity.

    Use the Debug view in eclipse to inspect runtime variables, etc, while the program is running.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Search on the forum as well. I'm not remember the exact title, but there is a thread discussion about debugging and I guess it's helpful to you.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  5. #5
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    6

    Default

    I have an idea, it's not automatic though.

    Use the same coding style through out your source. find and replace with // at the beginning. e.g.

    find: System.out.println("debug:
    replace with: //System.out.println("debug

    to undo:
    find: //System.out.println("debug:
    replace with: System.out.println("debug
    USE CODE TAGS--> [CODE]...[/CODE]
    Get NotePad++ (free)

  6. #6
    Krooger is offline Member
    Join Date
    Nov 2008
    Posts
    43
    Rep Power
    0

    Default

    Intresting Idea, but then the code is still there, plus I have I think about 20 classes. Heh I suppose if I really wanted to I could write somthing up that would find and remove the lines from my code and then insert them whenever, still impractical though. Would be a nice feature in eclipse, for me at least :P
    Hey I'm not very experienced yet, especially with plugins, but is this somthing you could write a plugin to do? If so, I'd probly spent some spare time researching that.

  7. #7
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    I wouldn't bother. It's good practice not to change any code in order to debug, but to change parameters or use a proper debugger.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by OrangeDog View Post
    I wouldn't bother. It's good practice not to change any code in order to debug, but to change parameters or use a proper debugger.
    I agreed with you OD, changing code time to time can cause lots of issues. Best things for me is use of a better debugger. Those we have lots of advance debugging tools. So why don't we use of them have a better solution in quick time.

Similar Threads

  1. Hiding Parameters From The Address Bar
    By Tirka in forum JavaServer Pages (JSP) and JSTL
    Replies: 5
    Last Post: 03-10-2009, 09:01 AM
  2. Password hiding
    By C.A.B.A.L. in forum New To Java
    Replies: 4
    Last Post: 03-04-2009, 09:25 AM
  3. URL Hiding
    By sandeeprao.techno in forum Advanced Java
    Replies: 4
    Last Post: 11-20-2008, 01:55 PM
  4. Hiding parameters from URL
    By Saurabh321 in forum New To Java
    Replies: 0
    Last Post: 02-05-2008, 01:43 PM
  5. Top menu fields hiding
    By youayshu in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 11-13-2007, 08:10 AM

Posting Permissions

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