Skip to content

Debugging

Edward Banner edited this page Jun 5, 2018 · 3 revisions

Inevitably you will run into an error in pynt. If you want to figure out for yourself what the problem is then I hope this material will guide you.

First line of defense: Logging

Run the following function.

M-x pynt-toggle-debug

This will enable pynt logging as well as EIN logging.

Open the *Messages*, *ein:log-all* and *ein:jupyter-server* buffers and then run do the thing that causes the bug. pynt logging goes to the first buffer, EIN logging goes to the second buffer, and jupyter notebook server output goes to the last buffer.

Imgur

Second line of defense: Debugging

If you can't discern the problem from logs then you can use the emacs debugger. Here are the steps you would go through for that.

  1. M-x toggle-debug-on-error so you can find out which function is causing the error.
  2. M-x describe-function RET <function> and then click on the link to the source.
  3. M-x eval-defun and supply the universal keyword argument.
  4. Call the function again to enter into edebug. Do edebug-step-mode (bound to s in spacemacs) enough times to get to the error. Hopefully you now know why the problem arose.
Clone this wiki locally