NAME

DBIx::Recordset::Debug - Perl extension for diverting DBIx::Recordset debug output to separate files.

SYNOPSIS

DBIx::Recordset::Debug::Debug({
    '!Level' => 4,
    '!File'  => $log_file{$_},
    '!Mode'  => '>'
    });

DESCRIPTION

Debug is to be called just before you call your accessor method (an accessor method being Setup/Insert/Search/Update/Delete) in order to stream debugging output for that particular accessor method to a particular file at a particular debug level.

If called with no arguments the default values are debug level 4, output file '/tmp/dbi-recordset.dbg', and write mode overwrite.

EXAMPLE

{ use DBIx::Recordset::Debug

package company::database;

 DBIx::Recordset::Debug::Debug({
     '!Level' => 4,
     '!File'  => $log_file{$_},
     '!Mode'  => '>'
     });

  *{$handle{$_}} = 
    DBIx::Recordset->Setup({
	%dsn, 
	'!Writemode' => $write_mode{$_}, 
	'!Tables' => $table_access{$_}
    }) for (keys $write_mode); }

The !File and !Mode arguments are passed directly on to the FileHandle module and will take either the overwrite or append syntax. Other syntaxes are rejected.

BUGS

The last part of the log does not go to the file because I did not force non-buffered output.

I don't know enough about select(), $| and local() to get this done. Help appreciated.

AUTHOR

Terrence M. Brannon <princepawn@yahoo.com>