Cloud Stack Ninja

How to print line numbers to the log. Say when outputting some information to the log, I also want to print the line number where that output is in the source code. As we can see in the stack trace, it displays the line number where the exception has occurred. Stack trace is available on the exception object.

Other alternative could be like manually including the line number when printing to the log. Is there any other way?



Read more here: https://stackoverflow.com/questions/115008/how-can-we-print-line-numbers-to-the-log-in-java

Content Attribution

This content was originally published by Bobby Kumar at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: