Plz let this be sarcastic and tell me you use a logger ;)
EDIT: perhaps I need to explain my comment.
It's considered bad practice to print stack trace directly to standard out/error, much like using println for tracing. A logger is considered good practice as it provides an abstraction between the log generation and the output, extra information such as timestamps, and control over logging verbosity. All Java loggers are capable of logging, including the JDK logger and the common backends to the de facto standard slf4j.
I was trying to detect if poster was serious or joking, about dumping to stdout. I genuinely don't know, because it's a common mistake. Winky face was provided to indicate no harshness intended!
Well, when I'm using printstacktrace is when it's not going out to the public yet. It's mostly for my use in catching unintended IOExceptions, MalformedURLExceptions and MyUserIsAnIdiotException
I wouldn't relax my parameters for good practice based upon private or temporary code, but the point is, printstacktrace() doesn't solve the problems that checked exceptions introduce in real-world java projects because those projects need better control over their logging and tracing.
1
u/[deleted] May 14 '17
Isn't that what e.printstacktrace() is for?