ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: Joshua Ballanco <jballanc@gmail.com>
To: ruby-core@ruby-lang.org
Subject: [ruby-core:56109] Re: [CommonRuby - Feature #8661][Open] Add option to print backstrace in reverse order(stack frames first & error last)
Date: Tue, 23 Jul 2013 04:56:13 +0900	[thread overview]
Message-ID: <CACHATVvg347a=yPb6ZBfCnPcrkSpzbpnhyi2bFGLq8nd+8_dtg@mail.gmail.com> (raw)
In-Reply-To: <redmine.issue-8661.20130721052006@ruby-lang.org>

[-- Attachment #1: Type: text/plain, Size: 2222 bytes --]

You can already accomplish something like this yourself:

    begin
      raise "Hello!"
    rescue Exception => e
      puts e.backtrace.reverse.join("\n")
      puts e.message
    end

Simple!


On Sat, Jul 20, 2013 at 11:20 PM, gary4gar (Gaurish Sharma) <
gary4gar@gmail.com> wrote:

>
> Issue #8661 has been reported by gary4gar (Gaurish Sharma).
>
> ----------------------------------------
> Feature #8661: Add option to print backstrace in reverse order(stack
> frames first & error last)
> https://bugs.ruby-lang.org/issues/8661
>
> Author: gary4gar (Gaurish Sharma)
> Status: Open
> Priority: Normal
> Assignee:
> Category:
> Target version:
>
>
> Currently the way ruby prints the backtrace is that the error comes first
> & then the stack frames. like this
>
>   Main Error Message
> stack frame 1
> stack frame 2
> stack frame 3
> .....
>
>  this is perfectly fine provided
>
> 1. Backstraces are short, so fits in terminal.hence, no need to scroll.
> 2. you read it from top to bottom.
>
>
> But, I am a rails developer where
>
> 1. Backstraces are always HUGE, therefore seldom don't fit in terminal.
> Means LOTS of scrolling to do everytime we get an error.
> 2. in terminal we tend to read backstraces from bottom to top, especially
> when tailing(tail -f) the production logs.
> 3. people, who practice Test-driven development literally spend most of
> their time scrolling to read backstraces to the point most end up buying a
> larger display.
>
> Proposed Solution:
>  Please add a way so we can configure backstraces to be printed in reverse
> order. so if you are reading from bottom, say from terminal, you can get
> the main error message without need to scroll. like this
>
>
>
> stack frame 3
> stack frame 2
> stack frame 1
>  Main Error Message
> .....
>
> this would save lot of time because when the error message is print at the
> bottom, no need to scroll for reading it. Not sure if this can be done
> today. I tried Overriding Exception#backtrace but it caused stack level too
> deep & illegal hardware instruction Error.
>
> Attached are currently what backstrace currently looks like & how there be
> an option to make it look for comparison.
>
>
> --
> http://bugs.ruby-lang.org/
>
>

[-- Attachment #2: Type: text/html, Size: 3028 bytes --]

  reply	other threads:[~2013-07-22 20:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-20 20:20 [ruby-core:56096] [CommonRuby - Feature #8661][Open] Add option to print backstrace in reverse order(stack frames first & error last) gary4gar (Gaurish Sharma)
2013-07-22 19:56 ` Joshua Ballanco [this message]
2013-07-23  2:09   ` [ruby-core:56117] " Nobuyoshi Nakada
2016-12-22 22:50 ` [ruby-core:78808] [CommonRuby Feature#8661] " x
2017-02-22  8:49 ` [ruby-core:79669] " nobu
2017-05-10 10:00 ` [ruby-core:81087] " eregontp
2017-05-10 10:01 ` [ruby-core:81088] " eregontp
2017-05-11  6:11 ` [ruby-core:81100] [CommonRuby Feature#8661][Assigned] " ko1
2017-05-19  6:09 ` [ruby-core:81246] [CommonRuby Feature#8661] " naruse
2017-05-20  2:14 ` [ruby-core:81299] " shyouhei
2017-10-03 13:06 ` [ruby-core:83088] " sonots
2017-11-29  7:46 ` [ruby-core:83953] " mame
2017-12-11 15:47 ` [ruby-core:84161] " kou
2017-12-24 15:09 ` [ruby-core:84428] " aeroastro007
2018-06-27  3:24 ` [ruby-core:87647] " samuel
2018-08-17 14:41 ` [ruby-core:88515] " mame
2018-08-18 17:45 ` [ruby-core:88545] " shevegen
2019-11-07  4:45 ` [ruby-core:95739] " mame

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACHATVvg347a=yPb6ZBfCnPcrkSpzbpnhyi2bFGLq8nd+8_dtg@mail.gmail.com' \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).