[Dbix-class] Tracing SQL - some nitpicks
Matt S Trout
dbix-class at trout.me.uk
Fri Jan 13 17:38:54 CET 2006
On Thu, Jan 12, 2006 at 11:47:01AM +0000, Nigel Metheringham wrote:
> So you can trace the SQL statements by doing
> $class->storage->debug(1)
>
> or setting the DBIX_CLASS_STORAGE_DBI_DEBUG environment variable.
>
>
> This causes this statement to fire in DBIx::Class::Storage::DBI:-
> warn "$sql: @bind" if $self->debug;
>
> I'd like to suggest a couple of changes here:-
> 1. Change the warn to a print to appropriate file handle. The
> addition of
> "at /usr/local/share/perl/5.8.7/DBIx/Class/Storage/DBI.pm line
> 184." to each trace line doesn't do much for me other than
> clutter the output with hash
> 2. Allow a filehandle to be passed to debug to allow the output to
> be pushed elsewhere.
>
> Does this sound sensible to you folks?
(1) can be achieved by appending a newline to the warn statement
(2) sounds like a great option; patch and test against current branch and
I'll add it.
--
Matt S Trout Offering custom development, consultancy and support
Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information
+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +
More information about the Dbix-class
mailing list