On Mon, Feb 09, 2004 at 11:47:55AM -0000, Orton, Yves wrote: > Hi, I was wondering if anybody had any advice on the following subjects: > > 1. How do you get "print" statements executed by the server? For instance, > I'm running Sybase, and on > > dump database foo to $file > > the server outputs a series of print statements as it does the backup. I > want to intercept these statements, but so far I can seem to see how to do > so.
That's driver specific currently. (Though drivers are expected to migrate to using a new mechanism that's included in DBI 1.41.) > 2. The log mechanism used by $dbh->trace() bypasses all of perls normal file > handling mechanisms. It doesnt print via *STDOUT/*STDERR but via perls > _internal_ equivelent. This means that any output from trace cannot be > intercepted by tieing these filehandles, as works almost everywhere else. > Nor can you specify '&1' or '&2' or '-' to get it to do so (you simply end > up with files with these as the name), nor can you provide a filehandle to > print to. This is a problem for me because this doesnt play very nicely > with other logging or a modular approach to tracing/logging. > > On a feature level I was wondering if there was any chance of being able to > provide a filehandle instead of a filename for trace() to use [...] That's long been on the to-do list. Patches welcome (see appended text). > ps: Tim, thanks for all your effort. A very powerful tool indeed. Thanks. Tim. =head2 How to create a patch using Subversion The DBI source code is maintained using Subversion (a replacement for CVS, see L<http://subversion.tigris.org/>). To access the source you'll need to install a Subversion client. Then, to get the source code, do: svn checkout http://svn.perl.org/modules/dbi/trunk If it prompts for a username and password use your perl.org account if you have one, else just 'guest' and 'guest'. After making your changes you can generate a patch file, but before you do, make sure your source is still upto date using: svn update http://svn.perl.org/modules/dbi/trunk If you get any conflicts reported you'll need to fix them first. Then generate the patch file using: svn diff > foo.patch Read the patch file, as a sanity check, and then email it to [EMAIL PROTECTED] =cut
