Skip to content

Debug macro makes function disappear when used with @Logging.configure (Logging.jl) #77

@essenciary

Description

@essenciary

This has been driving me nuts - in some situations the debugged function would disappear. After a ton of trial end error it turned out the culprit was Logging.jl, namely @Logging.configure

Not a terrible issue (I figured out it can be avoided, I'll tell you how in a sec) - but good to have it here as an issue in case it bites somebody else too.

Example:

ghost_function.jl
using Debug
using Logging

@Logging.configure(level=DEBUG)

function a()
  :a
end

function b()
  @info("b")
  :b
end

@debug function c()
  :c 
end

a()
b()
c()

At the REPL:

julia> include("ghost_function.jl")
03-Jun 22:54:34:DEBUG:root:#42#c
03-Jun 22:54:34:INFO:root:b
ERROR: LoadError: UndefVarError: c not defined
 in include at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
 in include_from_node1 at /usr/local/Cellar/julia/0.4.5/lib/julia/sys.dylib
while loading /Users/adrian/Dropbox/Projects/jinnie/_debug/ghost_function.jl, in expression starting on line 21

Using the logging functions instead of the logging macros seems to work - @Logging.configure(...) is what breaks it.

ghost_function_no_macro.jl
using Debug
using Logging

Logging.configure(level=DEBUG)

function a()
  :a
end

function b()
  info("b")
  :b
end

@debug function c()
  :c 
end

a()
b()
c()
julia> include("ghost_function_no_macro.jl")
03-Jun 23:04:07:INFO:root:b
:c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions