The Julia docs are pretty clear on how to enable debugging messages from @debug
macros, i.e. run export JULIA_DEBUG=mymodule
or export JULIA_DEBUG=all
on the command line before starting Julia. However, is there an easy way to enable debugging from within the Juno, or, more generally, while Julia is running?
I tried fiddling with Base.CoreLogging.disable_logging
, Base.CoreLogging.BelowMinLevel
and Base.CoreLogging._min_enabled_level
without success.
I know I can set env variables for Julia in the Juno settings. But that's kind of annoying to work with as it requires restarting Julia. I really want to have the following workflow while working interactively:
- Enter a line in the REPL
- Stumble upon a bug from your own code that you didn't see coming.
- Enable debugging.
- Run that line again.
- See the debug logs.
- Fix your code.
- Disable debug logging again.
Which I think is nicer than the common practice of commenting and un-commenting printf
everywhere.