Julia 中调试功能的替代品是什么?

May*_*ana 3 julia

julia> debug("hello")
ERROR: UndefVarError: debug not defined
Stacktrace:
 [1] top-level scope at REPL[6]:1
Run Code Online (Sandbox Code Playgroud)

即使尝试使用 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.
Run Code Online (Sandbox Code Playgroud)

Dav*_*ela 5

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

\n\n

您必须启用调试输出才能真正看到它。您可以使用环境变量启用它JULIA_DEBUG

\n\n
julia> @debug "hello"\n\njulia> ENV["JULIA_DEBUG"] = "all"\n"all"\n\njulia> @debug "hello"\n\xe2\x94\x8c Debug: hello\n\xe2\x94\x94 @ Main REPL[4]:1\n
Run Code Online (Sandbox Code Playgroud)\n