This package contains simple utilities that may help debug julia code.
pkg> dev https://github.com/timholy/DebuggingUtilities.jl.git
When you use it in packages, you should
activate the project and add
DebuggingUtilities as a dependency use
project> dev DebuggingUtilities.
@showln shows variable values and the line number at which the
statement was executed. This can be useful when variables change value
in the course of a single function. For example:
using DebuggingUtilities function foo() x = 5 @showln x x = 7 @showln x nothing end
might, when called (
foo()), produce output like
x = 5 (in foo at ./error.jl:26 at /tmp/showln_test.jl:5) x = 7 (in foo at ./error.jl:26 at /tmp/showln_test.jl:7)
This is similar to
include, except it displays progress. This can be
useful in debugging long scripts that cause, e.g., segfaults.
Also similar to
include, but it also measures the execution time of
each expression, and prints them in order of increasing duration.