在Julia中,调试函数的替代品是什么?

3
julia> debug("hello")
ERROR: UndefVarError: debug not defined
Stacktrace:
 [1] top-level scope at REPL[6]:1

即使使用Docker也找不到合适的替代方案。

help?> debug
search: @debug

Couldn't find debug
Perhaps you meant @debug, @enum, big or detach
  No documentation found.

  Binding debug does not exist.

https://docs.junolab.org/latest/man/debugging/ - Dunois
1个回答

5

使用@debug宏来打印调试输出。

你需要启用调试输出才能看到它。你可以使用环境变量JULIA_DEBUG来启用它:

julia> @debug "hello"

julia> ENV["JULIA_DEBUG"] = "all"
"all"

julia> @debug "hello"Debug: hello
└ @ Main REPL[4]:1

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接