From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 1384B1F454 for ; Thu, 7 Nov 2019 04:45:49 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 8D6EE120A0B; Thu, 7 Nov 2019 13:45:39 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 66979120A05 for ; Thu, 7 Nov 2019 13:45:37 +0900 (JST) Received: by filter0118p3las1.sendgrid.net with SMTP id filter0118p3las1-29752-5DC3A174-51 2019-11-07 04:45:41.103263879 +0000 UTC m=+123040.166921288 Received: from herokuapp.com (unknown [34.230.5.86]) by ismtpd0065p1iad1.sendgrid.net (SG) with ESMTP id n_iaB3ZzQ0OlNCqV6NeCHQ for ; Thu, 07 Nov 2019 04:45:40.829 +0000 (UTC) Date: Thu, 07 Nov 2019 04:45:41 +0000 (UTC) From: mame@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 71364 X-Redmine-Project: common-ruby X-Redmine-Issue-Id: 8661 X-Redmine-Issue-Author: gary4gar X-Redmine-Issue-Assignee: matz X-Redmine-Sender: mame X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?EJh2gqwnyqXtd++xo=2FinyA1V0bXouTB4FkWnzNiKb4=2FvdSPomT6BGEy3M7DhoX?= =?us-ascii?Q?HnOarET8JewG7YG7dvfSzVykGby3xtGWR+Zw6Hy?= =?us-ascii?Q?YxNwS2VKB6xZPAFns4+719+FFpx8KOW0Wbe0s9w?= =?us-ascii?Q?zAnfLj5zBfW4zzc5=2F1uZma46zVjKRT3kfbl1Qya?= =?us-ascii?Q?lMGpoSP73CLdH66Mr5xKUMwYINwE07TZU0w=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 95739 Subject: [ruby-core:95739] [CommonRuby Feature#8661] Add option to print backstrace in reverse order(stack frames first & error last) X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #8661 has been updated by mame (Yusuke Endoh). For the record: I am even surprised with myself, but I am not really used to the new order of the backtrace. I may be too old, but I wish the original backtrace order is back. ---------------------------------------- Feature #8661: Add option to print backstrace in reverse order(stack frames first & error last) https://bugs.ruby-lang.org/issues/8661#change-82558 * Author: gary4gar (Gaurish Sharma) * Status: Closed * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * 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. ---Files-------------------------------- current.log (5.13 KB) proposed.log (4.9 KB) -- https://bugs.ruby-lang.org/