Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to get the name of the currently executing method?

Reply
Thread Tools

How to get the name of the currently executing method?

 
 
Jeff Gaynor
Guest
Posts: n/a
 
      06-15-2004
Is there a way to do this? I just want to be able to print out a _quick_
message for debugging.

Thanks,

--j


 
Reply With Quote
 
 
 
 
Michael Borgwardt
Guest
Posts: n/a
 
      06-15-2004
Jeff Gaynor wrote:

> Is there a way to do this? I just want to be able to print out a _quick_
> message for debugging.


System.out.println("nameOfMethod");
Anything else is neither quick to write nor to execute.
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      06-15-2004
On Tue, 15 Jun 2004 11:39:33 -0500 (CDT), "Jeff Gaynor"
<(E-Mail Removed)> wrote or quoted :

>Is there a way to do this? I just want to be able to print out a _quick_
>message for debugging.


new Throwable().printStackTrace()

There are even slicker ways if you just want the current method.

See http://mindprod.com/jgloss/trace.html

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
ak
Guest
Posts: n/a
 
      06-15-2004
Thread#dumpStack();

--
http://uio.dev.java.net Unified I/O for Java
http://reader.imagero.com Java image reader


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
overwriting jars currently executing visionset Java 4 04-13-2007 08:33 PM
Get path of currently-executing Ruby interpreter Bill Atkins Ruby 1 08-09-2005 04:20 PM
How to get the currently executing page handler? Stefan ASP .Net 2 07-26-2005 03:41 PM
Access to currently executing Page object Chris Newby ASP .Net 2 04-19-2005 09:38 PM
Having a problem using WebRequest inside code invoked by the Page_Load event to to download a page located on same server (as the currently executing page). Hasani \(remove nospam from address\) ASP .Net 9 09-29-2004 05:07 PM



Advertisments