Is there anything in julia at the moment, that allows statements to be printed that give an idea of what is going on inside a function, only if the script or function is run during a debug mode?
Something like @debug println("Finished looping: i is $(i)")?
We ended up coming up with our own macros for logging also (with a bit of weird syntax magic I got from my friends on the JuliaLang/julia - Gitter Gitter chat room. @error(()->errorcode, message), @fatal(()->errorcode, message), @warn(()->errorcode, message), @info(()->errorcode, message)
The macro doesn’t execute the anonymous function, but instead uses it to get the __FILE__ and __LINE__ information, which unfortunately is otherwise unavailable from within a macro call (actually just one of them isn’t).
We use other flags and level settings to determine whether the macros 1) get compiled into the code (for warning and info messages) or 2) it is logged or not (run-time check based on level/flags)