Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- } catch (Exception ex) {
- ex.printStackTrace(new PrintStream(yourOutputStream));
- }
- catch(Exception e) {
- e.printStacktrace(System.out);
- }
- StringWriter writer = new StringWriter();
- PrintWriter printWriter = new PrintWriter( writer );
- exception.printStackTrace( printWriter );
- printWriter.flush();
- String stackTrace = writer.toString();
- out = some stream ...
- try
- {
- }
- catch ( Exception cause )
- {
- cause . printStrackTrace ( new PrintStream ( out ) ) ;
- }
Add Comment
Please, Sign In to add comment