collective / rapido.core

2 stars 2 forks source link

ability to debug online #19

Open djay opened 8 years ago

djay commented 8 years ago

User problem

When working out whats wrong your code can be a pain. Your options are to return debug messages via http or exceptions. Or use logs (which you have to look at via the commandline.

Needs some brainstorming about how improve debugging code in an environment where you don't have access to the commandline and where you can't afford to have threads sitting and waiting.

Options

stateless web pdb.

Not sure if it would work but the idea would be

  1. do something like set_trace() in the code
  2. abort the transaction and send back a display with a pdb prompt
  3. entered command stored in a cookie and request is retried
  4. when the set_trace is hit, the cookie with past commands is replayed, output collected, transaction aborted and output sent back with next pdb prompt

    log console in the toolbar.

Normal log, or something like this - https://github.com/zestyping/q

Perhaps include in http headers as well?

ebrehault commented 8 years ago

rapido.plone already pushes the log messages and the error traceback in the web browser console. That's quite handy, but it only works when your block is embedded in a Plone page (because it needs the rapdio js bundle). When you call the JSON API, or if you load a block directly, there is no way to use this mechanism.

Solutions: