import pkg/debug
# wrap everything in debug
debug:
echo "Starting example"
var x = 10
let y = 20
x = x + y
if x > 15:
echo "x is large"
x = x * 2
else:
echo "x is small"
for i in 1..3:
noDebug: # disables
echo "Loop iteration: ", i
if i == 2:
echo "Found 2!"
Run normally
nim c -r test.nim Inspect
debug

zsh
git clone https://github.com/thing-king/debug.git
Cloning into 'debug'...
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (19/19), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 19 (delta 6), reused 9 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (19/19), 16.88 KiB | 8.44 MiB/s, done.
Resolving deltas: 100% (6/6), done.
dennismisener@Denniss-iMac Development % cd debug
dennismisener@Denniss-iMac debug % nim c -c example.nim
Hint: used config file '/Users/dennismisener/.choosenim/toolchains/nim-2.2.6/config/nim.cfg' [Conf]
Hint: used config file '/Users/dennismisener/.choosenim/toolchains/nim-2.2.6/config/config.nims' [Conf]
.......................................................................
/Users/dennismisener/Development/debug/src/debug.nim(8, 8) Error: cannot open file: macros2
dennismisener@Denniss-iMac debug % I think jsony_plus should be included in the nimble file also. I was getting the missing jsony package error.
https://github.com/thing-king/jsony_plus
Thanks for the cool project anyway.