Skip to content

Debugging functions with log macros is very annoying #350

Description

@fredrikekre

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions