-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the readability of stack traces #1458
Comments
Some examples of panic outputs in different environments for inspiration are below. They use very simple inputs, so their utility may be limited, but maybe we can learn something from them. I also understand that the diagnostic events are not stack traces, and they don't point to code, but developers sort of treat them as similar, as a way to understand where the program was when something went wrong. Rustfn main() {
f1(1)
}
fn f1(i: u32) {
f2()
}
fn f2() {
f3()
}
fn f3() {
panic!("oh no")
}
Gopackage main
func main() {
f1(1)
}
func f1(i int) {
f2()
}
func f2() {
f3()
}
func f3() {
panic("oh no")
}
Nodefunction f1(i) {
f2();
}
function f2() {
f3();
}
function f3() {
throw "oh no";
}
f1(1);
Bunfunction f1(i) {
f2();
}
function f2() {
f3();
}
function f3() {
throw "oh no";
}
f1(1);
Denofunction f1(i: u32) {
f2();
}
function f2() {
f3();
}
function f3() {
throw "oh no";
}
f1(1);
Pythondef f1(i):
f2()
def f2():
f3()
def f3():
raise Exception("oh no")
f1(1)
Rubydef f1(i)
f2()
end
def f2()
f3()
end
def f3()
raise "oh no"
end
f1(1)
Javapublic class Main {
public static void main(String[] args) {
f1(1);
}
public static void f1(int i) {
f2();
}
public static void f2() {
f3();
}
public static void f3() {
throw new RuntimeException("oh no");
}
}
.NETusing System;
public class Program
{
public static void Main()
{
f1(1);
}
public static void f1(int i) {
f2();
}
public static void f2() {
f3();
}
public static void f3() {
throw new Exception("oh no");
}
}
Swiftimport Foundation
func f1(i: Int) {
f2();
}
func f2() {
f3();
}
func f3() {
fatalError("oh no");
}
f1(i: 1);
Zigpub fn main() !void {
f1(1);
}
fn f1(_: i32) void {
f2();
}
fn f2() void {
f3();
}
fn f3() void {
@panic("oh no");
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think we should improve the readability of the diagnostic event and stack trace outputs that the environment generates on the console and in tests when there are failures.
This is not about improving the contents / data within the diagnostic events, and only the presentation of the existing data, so it is easier to glance and digest.
An example of the existing output as of
v21.2.1
:The text was updated successfully, but these errors were encountered: