From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.5 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id A31721F954 for ; Sat, 18 Aug 2018 17:46:07 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 7F8AA120998; Sun, 19 Aug 2018 02:46:05 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id B351C120996 for ; Sun, 19 Aug 2018 02:46:02 +0900 (JST) Received: by filter0051p3mdw1.sendgrid.net with SMTP id filter0051p3mdw1-29335-5B785B56-1 2018-08-18 17:45:58.056897053 +0000 UTC m=+71869.146921227 Received: from herokuapp.com (ec2-54-205-121-2.compute-1.amazonaws.com [54.205.121.2]) by ismtpd0016p1iad2.sendgrid.net (SG) with ESMTP id qnJrN18bRKqwKdvlCTdPYw Sat, 18 Aug 2018 17:45:57.964 +0000 (UTC) Date: Sat, 18 Aug 2018 17:45:58 +0000 (UTC) From: shevegen@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 63929 X-Redmine-Project: common-ruby X-Redmine-Issue-Id: 8661 X-Redmine-Issue-Author: gary4gar X-Redmine-Issue-Assignee: matz X-Redmine-Sender: shevegen 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: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS4QxcZMDwVvL1T925AKUoBbk4opHEHxS7ZB3m qr1j0vYXUV4Im3bWE64yASJBispnRcLpIIsyXcoBPGR1MncjKfs8c+6zieWY2KXhjbKug9Rad9R0CA Zm0R78Iz36fVjKyuCTvsw85YhAVApwKKLuiOrhwbuLK44vrx/hQ5DH6Y3w== X-ML-Name: ruby-core X-Mail-Count: 88545 Subject: [ruby-core:88545] [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 shevegen (Robert A. Heiler). I think I agree with mame - perhaps it should be reverted for now. There was another ruby hacker from japan who wrote, some time ago (a year or two?), that he was confused about it too; I don't remember where it was but I think it was in a standalone proposal some time ago. In my opinion, the best would be to find a way to be able to fully customize the behaviour/display that ruby uses for reporting warnings/errors, with a default chosen that may be most appropriate for the most common ways to display the issues at hand (I have no preference to the default chosen here, but perhaps we should revert to the behaviour ruby used to use; and then allow full customization for people to adapt it to their own personal needs). I assume that matz may not have a huge preference either, so perhaps we should (lateron?) focus on some way to be able to customize how ruby treats warnings/errors or rather, display them. An obvious way may be to allow for environment variables. An additional way may be to pick something at compile time (so that people can customize it for their own host system, as a default), and perhaps also a --user flag directive of some sorts; and perhaps additionally something like $VERBOSE, but through some core method call or something instead. I should, however had, also note that while I think I prefer the old behaviour, to me personally it is not a huge deal either way - I just can understand everyone who may not like the chosen default as-is. The only thing that I personally found hard was when the filenames are very long and the error is somewhere deep down in code that gets called by lots of other methods in different files - then the error messages are "overflowing" to the right of my screen display, so in this case, I would prefer a shorter message, or perhaps split up onto several lines; I kind of focus on the left hand side of my screen normally. But again, it's not really something I personally am deeply invested - I am personally am more looking as to how mjit is progressing. :) ---------------------------------------- Feature #8661: Add option to print backstrace in reverse order(stack frames first & error last) https://bugs.ruby-lang.org/issues/8661#change-73606 * 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/