From: Chris W. <ch...@cw...> - 2002-03-05 04:12:06
|
On Mon, 2002-03-04 at 18:19, John Sequeira wrote: > Drat. I've got 0.56 and I don't see the trace output in the apache log. > I'll scope the change logs to see if it's new. IIRC this has been in there for a while, so I'm not sure what the problem is. What happens when you create a self-contained (and more easily debugged) script, like: ---------- #!/usr/bin/perl use strict; use OpenInteract::Startup; { my $R = OpenInteract::Startup->setup_static_environment_options( undef, {}, { temp_lib => 'lazy' } ); $R->user->fetch_group({ where => 'last_name like ?', value => 'smi%' }); } ---------- > > > Also, is there another way to get this info for debugging? > > > > Not right now. Did you have an idea about another way to get it? > > Debugging has always kind of been a PITA, so ideas are welcome. > > The other way I'd like to see the debug flag implemented is at the > connection level. This is an interesting idea. Actually, you can implement this now for debugging purposes if you like. I probably won't put this in the final code (performance), but maybe I'll make it conditional on the debug being set in the datasource... In any case, add the following to OpenInteract::SPOPS::DBI: sub fetch_group { my ( $class, $p ) = @_; my $CONFIG = OpenInteract::Request->instance->CONFIG; my $datasource = $class->CONFIG->{datasource} || $CONFIG->{datasource}{default_connection_db}; if ( $CONFIG->{datasource}{debug} ) { $p->{DEBUG} = $CONFIG->{datasource}{debug}; } return $class->SUPER::fetch_group( $p ); } This should enable you to use the configuration syntax you suggested: > $data = { > 'db_info' => { > 'db_owner' => '', > 'username' => 'test', > ... > 'driver_name' => 'mysql', > 'debug' => 1 > }, > ... > }; > Also, it'd be cool if you delimited the SQL trace output in such a way that > it could be easily grep'd out of the apache log file. This is another interesting idea. We'd have to do something like split the data into lines and then lead each debugging SQL line with a particular string... I'll think about this one. Later, Chris (cc'ing to oi-dev for posterity, etc.) -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |