JuliaDebug / JuliaDebug/Debugger.jl
Debugging functions with log macros is very annoying
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 514
- Forks
- 50
- Avg merge
- 9d 9h
- Merged PRs (30d)
- 1
Description
For example:
julia> function f()
x = rand(4)
@info "hello"
y = rand(4)
return x, y
end
f (generic function with 1 method)
julia> @enter f()
[ Info: Loading Debugger ...
In f() at REPL[1]:1
1 function f()
>2 x = rand(4)
3 @info "hello"
4 y = rand(4)
5 return x, y
6 end
About to run: (rand)(4)
1|debug> n
In f() at REPL[1]:1
382 let
383 level = $level
384 # simplify std_level code emitted, if we know it is one of our global constants
385 std_level = $(level isa Symbol ? :level : :(level isa $LogLevel ? level : convert($LogLevel, level)::$LogLevel))
>386 if std_level >= $(_min_enabled_level)[]
387 group = $(log_data._group)
388 _module = $(log_data._module)
389 logger = $(current_logger_for_env)(std_level, group, _module)
390 if !(logger === nothing)
About to run: (getindex)(Base.RefValue{Base.CoreLogging.LogLevel}(Debug))
There seems to be no easy way to step out of the logging code so you kinda have to n your way through it...
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the example from the issue with @enter f() and step through the @info call using n. Start by tracing how the debugger handles logging macros and identify an appropriate way to return to the user's function. Done should mean stepping over or out of logging code without manually traversing its internals.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100