Skip to content
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

Debugging functions with log macros is very annoying #350

Open
fredrikekre opened this issue Jul 3, 2024 · 0 comments
Open

Debugging functions with log macros is very annoying #350

fredrikekre opened this issue Jul 3, 2024 · 0 comments

Comments

@fredrikekre
Copy link
Contributor

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant