[development] Debugging updates

Arto Bendiken arto.bendiken at gmail.com
Fri Oct 19 20:53:16 UTC 2007

On 10/19/07, Karen Stevenson <karen at elderweb.com> wrote:
> Does anyone have ideas for ways to debug update functions in the install file figure out what's going on when they don't work as expected or when I get reports of problems?
> Is there any way to see the query logs that the devel module creates from within updates? If I use update_sql() I can tell what queries ran, but there are times when I need to use db_query() instead and I can get no clue to what is going on when that runs. And I can't find any way to display messages back to myself or see results of print_r() or any of the other things I do elsewhere to debug scripts.

You could try: http://drupal.org/project/trace

I often have the trace log open in a terminal, monitoring it in
realtime with "tail -f files/trace.log". This allows a convenient
"side channel" for debug messages, which you can print out e.g. with
trace('debug', $my_troublesome_var);

The module will trace the SQL queries, too. You can limit it to e.g.
only output UPDATE queries.

Arto Bendiken | http://bendiken.net/

More information about the development mailing list