Re: Making trace show more than 2 elements
On 27/09/13 17:12, demerphq wrote: On 27 September 2013 17:41, Martin J. Evans wrote: On 27/09/13 16:29, demerphq wrote:> On 27 September 2013 17:08, Martin J. Evans wrote: On 27/09/13 15:37, demerphq wrote: Is there an undocumented magic variable that will make DBI trace mode show more than the first two arguments to a function like selectrow_array() or similar? Cheers, Yves Works for me: DBI_TRACE=15=x.log perl -Iblib/lib/ -Iblib/arch/ -MDBI -le 'my $h = DBI->connect("dbi:ODBC:xxx","xx","xx"); my $x = $h->selectrow_arrayref(q/select * from mje where a= ?/, undef, "a");' trace shows 3 arguments: -> selectrow_arrayref for DBD::ODBC::db (DBI::db=HASH(0x9385508)~0x938542c 'select * from mje where a= ?' undef 'a') thr#9215008 There is also DBIx::Log4perl and DBIx::LogAny too if you want to trace just method calls and arguments. Gah, that outputs too much junk at the same time Which outputs too much junk at the same time? level 15 tracing or DBIx::Log4perl? Level 15 tracing. I do my best to avoid log4perl (but that is a religious discussion best left to other forums :-) There is DBIx::LogAny too. Martin
Re: Making trace show more than 2 elements
On 27 September 2013 17:41, Martin J. Evans wrote: > On 27/09/13 16:29, demerphq wrote:> On 27 September 2013 17:08, Martin J. > Evans wrote: >>> >>> On 27/09/13 15:37, demerphq wrote: Is there an undocumented magic variable that will make DBI trace mode show more than the first two arguments to a function like selectrow_array() or similar? Cheers, Yves >>> >>> Works for me: >>> >>> DBI_TRACE=15=x.log perl -Iblib/lib/ -Iblib/arch/ -MDBI -le 'my $h = >>> DBI->connect("dbi:ODBC:xxx","xx","xx"); my $x = >>> $h->selectrow_arrayref(q/select * from mje where a= ?/, undef, "a");' >>> >>> trace shows 3 arguments: >>> >>> -> selectrow_arrayref for DBD::ODBC::db >>> (DBI::db=HASH(0x9385508)~0x938542c 'select * from mje where a= ?' undef >>> 'a') >>> thr#9215008 >>> >>> There is also DBIx::Log4perl and DBIx::LogAny too if you want to trace >>> just >>> method calls and arguments. >> >> >> Gah, that outputs too much junk at the same time > > > Which outputs too much junk at the same time? level 15 tracing or > DBIx::Log4perl? Level 15 tracing. I do my best to avoid log4perl (but that is a religious discussion best left to other forums :-) > >> I want to control it at DBI->trace(1) level. IOW, I dont want low >> level debug on the DBI calls, I want the output from trace(1) but with >> all the arguments. > > > You didn't mention trace level 1 before. Now I see what you mean: > > DBI_TRACE=1=x.log perl -Iblib/lib/ -Iblib/arch/ -MDBI -le 'my $h = > DBI->connect("dbi:ODBC:xx","xx","xx"); my $x = > $h->selectrow_arrayref(q/select * from mje where a= ?/, undef, "a");' > > <- selectrow_arrayref('select * from mje where a= ?', undef, ...)= ( [ > 'a' 'b' ] ) [1 items] at -e line 1 > > >> I can change how much of a given string I see with $DBI::neat_maxlen >> but there doesnt seem to a be a $DBI::neat_list_maxitems or >> equivalent >> >> cheers, >> Yves >> >> > > No, there isn't. I wouldn't imagine it would be too hard to add though (not > that I looked). Ok, thanks. Maybe ill work out a patch. Yves -- perl -Mre=debug -e "/just|another|perl|hacker/"
Re: Making trace show more than 2 elements
On 27/09/13 16:29, demerphq wrote:> On 27 September 2013 17:08, Martin J. Evans wrote: On 27/09/13 15:37, demerphq wrote: Is there an undocumented magic variable that will make DBI trace mode show more than the first two arguments to a function like selectrow_array() or similar? Cheers, Yves Works for me: DBI_TRACE=15=x.log perl -Iblib/lib/ -Iblib/arch/ -MDBI -le 'my $h = DBI->connect("dbi:ODBC:xxx","xx","xx"); my $x = $h->selectrow_arrayref(q/select * from mje where a= ?/, undef, "a");' trace shows 3 arguments: -> selectrow_arrayref for DBD::ODBC::db (DBI::db=HASH(0x9385508)~0x938542c 'select * from mje where a= ?' undef 'a') thr#9215008 There is also DBIx::Log4perl and DBIx::LogAny too if you want to trace just method calls and arguments. Gah, that outputs too much junk at the same time Which outputs too much junk at the same time? level 15 tracing or DBIx::Log4perl? I want to control it at DBI->trace(1) level. IOW, I dont want low level debug on the DBI calls, I want the output from trace(1) but with all the arguments. You didn't mention trace level 1 before. Now I see what you mean: DBI_TRACE=1=x.log perl -Iblib/lib/ -Iblib/arch/ -MDBI -le 'my $h = DBI->connect("dbi:ODBC:xx","xx","xx"); my $x = $h->selectrow_arrayref(q/select * from mje where a= ?/, undef, "a");' <- selectrow_arrayref('select * from mje where a= ?', undef, ...)= ( [ 'a' 'b' ] ) [1 items] at -e line 1 I can change how much of a given string I see with $DBI::neat_maxlen but there doesnt seem to a be a $DBI::neat_list_maxitems or equivalent cheers, Yves No, there isn't. I wouldn't imagine it would be too hard to add though (not that I looked). Martin
Re: Making trace show more than 2 elements
On 27 September 2013 17:29, demerphq wrote: > On 27 September 2013 17:08, Martin J. Evans wrote: >> On 27/09/13 15:37, demerphq wrote: >>> >>> Is there an undocumented magic variable that will make DBI trace mode >>> show more than the first two arguments to a function like >>> selectrow_array() or similar? >>> >>> Cheers, >>> Yves >>> >> >> Works for me: >> >> DBI_TRACE=15=x.log perl -Iblib/lib/ -Iblib/arch/ -MDBI -le 'my $h = >> DBI->connect("dbi:ODBC:xxx","xx","xx"); my $x = >> $h->selectrow_arrayref(q/select * from mje where a= ?/, undef, "a");' >> >> trace shows 3 arguments: >> >> -> selectrow_arrayref for DBD::ODBC::db >> (DBI::db=HASH(0x9385508)~0x938542c 'select * from mje where a= ?' undef 'a') >> thr#9215008 >> >> There is also DBIx::Log4perl and DBIx::LogAny too if you want to trace just >> method calls and arguments. > > Gah, that outputs too much junk at the same time > > I want to control it at DBI->trace(1) level. IOW, I dont want low > level debug on the DBI calls, I want the output from trace(1) but with > all the arguments. > > I can change how much of a given string I see with $DBI::neat_maxlen > but there doesnt seem to a be a $DBI::neat_list_maxitems or > equivalent Do forgive me for being rude, I didnt mean to "gah" at you. Thanks for replying... :-) Yves -- perl -Mre=debug -e "/just|another|perl|hacker/"
Re: Making trace show more than 2 elements
On 27 September 2013 17:08, Martin J. Evans wrote: > On 27/09/13 15:37, demerphq wrote: >> >> Is there an undocumented magic variable that will make DBI trace mode >> show more than the first two arguments to a function like >> selectrow_array() or similar? >> >> Cheers, >> Yves >> > > Works for me: > > DBI_TRACE=15=x.log perl -Iblib/lib/ -Iblib/arch/ -MDBI -le 'my $h = > DBI->connect("dbi:ODBC:xxx","xx","xx"); my $x = > $h->selectrow_arrayref(q/select * from mje where a= ?/, undef, "a");' > > trace shows 3 arguments: > > -> selectrow_arrayref for DBD::ODBC::db > (DBI::db=HASH(0x9385508)~0x938542c 'select * from mje where a= ?' undef 'a') > thr#9215008 > > There is also DBIx::Log4perl and DBIx::LogAny too if you want to trace just > method calls and arguments. Gah, that outputs too much junk at the same time I want to control it at DBI->trace(1) level. IOW, I dont want low level debug on the DBI calls, I want the output from trace(1) but with all the arguments. I can change how much of a given string I see with $DBI::neat_maxlen but there doesnt seem to a be a $DBI::neat_list_maxitems or equivalent cheers, Yves -- perl -Mre=debug -e "/just|another|perl|hacker/"
Re: Making trace show more than 2 elements
On 27/09/13 15:37, demerphq wrote: Is there an undocumented magic variable that will make DBI trace mode show more than the first two arguments to a function like selectrow_array() or similar? Cheers, Yves Works for me: DBI_TRACE=15=x.log perl -Iblib/lib/ -Iblib/arch/ -MDBI -le 'my $h = DBI->connect("dbi:ODBC:xxx","xx","xx"); my $x = $h->selectrow_arrayref(q/select * from mje where a= ?/, undef, "a");' trace shows 3 arguments: -> selectrow_arrayref for DBD::ODBC::db (DBI::db=HASH(0x9385508)~0x938542c 'select * from mje where a= ?' undef 'a') thr#9215008 There is also DBIx::Log4perl and DBIx::LogAny too if you want to trace just method calls and arguments. Martin
Making trace show more than 2 elements
Is there an undocumented magic variable that will make DBI trace mode show more than the first two arguments to a function like selectrow_array() or similar? Cheers, Yves -- perl -Mre=debug -e "/just|another|perl|hacker/"