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

Error when debugging function with log statement #318

Closed
fredrikekre opened this issue Jun 21, 2022 · 2 comments
Closed

Error when debugging function with log statement #318

fredrikekre opened this issue Jun 21, 2022 · 2 comments

Comments

@fredrikekre
Copy link
Contributor

fredrikekre commented Jun 21, 2022

julia> using Debugger

julia> function foo()
           x = rand(2)
           @info "hello" x
           y = sum(x)
           return y
       end
foo (generic function with 1 method)

julia> @enter foo()
In foo() at REPL[2]:1
 1  function foo()
>2      x = rand(2)
 3      @info "hello" x
 4      y = sum(x)
 5      return y
 6  end

About to run: (rand)(2)
1|debug> n
In foo() at REPL[2]:1
 368  end
 369  return quote
 370      let
 371          level = $level
>372          std_level = convert(LogLevel, level)
 373          if std_level >= _min_enabled_level[]
 374              group = $(log_data._group)
 375              _module = $(log_data._module)
 376              logger = current_logger_for_env(std_level, group, _module)

About to run: (convert)(Base.CoreLogging.LogLevel, Info)
1|debug> so
ERROR: UndefVarError: REPL[2] not defined                                  <----------------------
Stacktrace:
 [1] _invoked_shouldlog(logger::Logging.ConsoleLogger, level::Base.CoreLogging.LogLevel, _module::Module, group::Symbol, id::Symbol)
   @ Base.CoreLogging logging.jl:78
 [2] foo()
   @ Main logging.jl:381
@KristofferC
Copy link
Member

I'm guessing there is a Symbol("REPL[2]") that is not getting quote when getting evaled or something.

@pfitzseb
Copy link
Member

Dup of JuliaDebug/JuliaInterpreter.jl#535.

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

3 participants