Recording source code information in Java trace


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Recording source code information in Java trace

  1. #1
    Kristian Luck Guest

    Recording source code information in Java trace


    I want to build a logging utility for my Java application. In C/C++, preprocessor
    macros can be used to embed the name of the source code file and the line
    at which a method was invoked (usually for debugging this is great). Is
    there any way to get similar information in Java?

    Thanks.

  2. #2
    Paul Clapham Guest

    Re: Recording source code information in Java trace

    I have always found the plain old System.out.println("About to reverse the
    frammistan") type of debugging to be perfectly satisfactory. You can
    redirect its output to a file if there is too much of it. I can't imagine a
    trace using line numbers being particularly useful unless I didn't have a
    clue what my program was doing (like if somebody else wrote it).

    Kristian Luck <kristian.luck@innovatia.net> wrote in message
    news:3975c50d$1@news.devx.com...
    >
    > I want to build a logging utility for my Java application. In C/C++,

    preprocessor
    > macros can be used to embed the name of the source code file and the line
    > at which a method was invoked (usually for debugging this is great). Is
    > there any way to get similar information in Java?
    >
    > Thanks.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center