• Post Reply Bookmark Topic Watch Topic
  • New Topic

Printing stacktrace  RSS feed

 
Bob Matthews
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my java program I use the following approach a lot when printing out data to view :-



How do I code the stacktrace printout to go to the same place?

 
Carey Brown
Bartender
Posts: 3022
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See javadocs for Throwable.printStackTrace(...). There are 1 or 2 flavors of these methods that may help you to do what you want. As an example, one of them takes a PrintStream as an argument.
 
Bob Matthews
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you do something like ?





 
Carey Brown
Bartender
Posts: 3022
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bob Matthews wrote:can you do something like ?


Might be something more like
 
Bob Matthews
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many thanks Carey

Spot on!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!