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

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

Open
essenciary opened this issue Jun 3, 2016 · 0 comments

Comments

@essenciary
Copy link

essenciary commented Jun 3, 2016

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