[Dbix-class] Tracing SQL - some nitpicks

Nigel Metheringham nigel.metheringham at dev.intechnology.co.uk
Thu Jan 12 12:47:01 CET 2006


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?

	Nigel.

-- 
[ Nigel Metheringham           Nigel.Metheringham at InTechnology.co.uk ]
[ - Comments in this message are my own and not ITO opinion/policy - ]





More information about the Dbix-class mailing list