Forum OpenACS Development: making debug=1 useful

Collapse
Posted by Arjun Sanyal on
As anyone who has tried knows, setting debug=1 in the aolserver
configuration fills up your hard drive with a torrent of data of which
only a tiny fraction is useful for debuging. Most of this spew is
internal logging of the query dispatcher but it's in other places as
well. however, there is some bits of useful information about the
currently running query in the haystack: is it in a tcl library or a
www page? what's the query's full name, etc.

I've hacked the most of the files that contribute to this. I didn't
remove any of the logging calls, but rather added a few simple procs
so that if you want all the QD, XML parsing, SC or APM
debugging turned on you just change a string from "QDDebug" to
"Debug", for example. I didn't change the warning messages like "No
fullquery for foo.."

I've cleaned the restart spew to 3 lines perparsed file.

Each query is now prefaced with a line like:

[13/Aug/2002:20:33:47][20836.4101][-conn1-] Debug: db_qd_get_fullname:
following query in file: packages.acs-tcl.tcl.acs-permissions-procs
proc: permission::permission_p

that tells you exactly where it is and what it's called. you still get
the query output 4 times, but that's in the driver, i believe. I'd
like to see each query twice, with and without bind vars. Hint, hint
DanW :)

If there are no objections to this, i'll be committing these changes
tomorrow.

Collapse
Posted by Dan Wickstrom on
Well I guess I can take a hint. Since I still haven't been added to the sudoers list on openacs.org, maybe you could fix cvs? I get the following error trying to checkout the driver:

1096 nsadmin@localhost:~/sourceforge >cvs -ddanw@openacs.org:/cvsroot co postgresql-driver danw@openacs.org's password: cvs server: Updating postgresql-driver cvs server: failed to create lock directory for `/cvsroot/postgresql-driver' (/cvsroot/postgresql-driver/#cvs.lock): Permission denied
cvs server: failed to obtain dir lock in repository `/cvsroot/postgresql-driver' cvs [server aborted]: read lock failed - giving up                                                                                   

Collapse
Posted by Arjun Sanyal on
cvs fixed
Collapse
Posted by Dan Wickstrom on
I've modified the pg driver to remove most of the debug output.  Now you will only get one copy of the query with bind vars substituted, and that will only happen if the db handle is in verbose mode.  I'm assuming that the QD will output the query before bind variable substitution.
Collapse
Posted by Don Baccus on
Dan, the CVS problem was probably my fault because I'm the person who loaded it there in the first place.

Sorry!