- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Add the InteractiveUtils.diagnostics()
and InteractiveUtils.stdlib_diagnostics()
functions
#43834
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
base: master
Are you sure you want to change the base?
Conversation
A while ago on Slack, @GunnarFarneback suggested having a
I think that it might be good to add that information to the |
acafe8c
to
8b6737c
Compare
This seems like a good idea to me. I wonder if we could do this as a hook-type system, so that this function is just a little stub which is implemented as: function diagnostics(io=stdout)
println(io, "# header info:")
println(io, " ?")
for m in sort!(Base.loaded_modules_array(), by=nameof)
if isdefined(m, :__diagnostics__) && applicable(m.__diagnostics__, io)
println(io, "# " nameof(m))
println(io, "-"^length(String(nameof(m)))
m.__diagnostics__(io)
println()
end
end
println(io, "# footer info")
println(io, " ?")
end |
b058cd0
to
76ac73b
Compare
36179c2
to
e5bcd30
Compare
InteractiveUtils.diagnostics()
functionInteractiveUtils.diagnostics()
and InteractiveUtils.stdlib_diagnostics()
functions
…_diagnostics()` functions
deef130
to
45416e7
Compare
InteractiveUtils.diagnostics()
and InteractiveUtils.stdlib_diagnostics()
functionsInteractiveUtils.diagnostics()
and InteractiveUtils.stdlib_diagnostics()
functions
I like the idea of the hook-type system. I've implemented that approach here. I've also made a few PRs to external stdlibs to add |
Base.showerror(io, ex) | ||
Base.show_backtrace(io, bt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Base.showerror(io, ex) | |
Base.show_backtrace(io, bt) | |
Base.showerror(io, catch_stack()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per https://docs.julialang.org/en/v1.8-dev/base/base/#Base.current_exceptions, it looks like catch_stack()
has been renamed in 1.7 and later?
Seems ok to me. Request from @StefanKarpinski : return a TOML-compatible data structure that prints nicely, so it can be processed programmatically. |
This PR is an attempt to create an "all-in-one" debugging function that dumps as much debugging information as possible. That way, when a user opens a new bug report, instead of needing to run ten or twenty different commands, they can just run a single command (
InteractiveUtils.diagnostics()
) and post the output of that command (after confirming that the output does not contain any information that should not be shared publicly).