X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FReplicated%2FWithDSN.pm;h=602573901c543ee6a7defe6d4f3175cfd2b6335f;hb=d4daee7b54e38e4b3d3d0a77759bddc1a4ede6e5;hp=69a3add4f5619fb729c952668604092589150482;hpb=ee356d004e088518205ac720b37c31a64c9cd861;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/Replicated/WithDSN.pm b/lib/DBIx/Class/Storage/DBI/Replicated/WithDSN.pm index 69a3add..6025739 100644 --- a/lib/DBIx/Class/Storage/DBI/Replicated/WithDSN.pm +++ b/lib/DBIx/Class/Storage/DBI/Replicated/WithDSN.pm @@ -13,7 +13,7 @@ information in trace output =head1 SYNOPSIS This class is used internally by L. - + =head1 DESCRIPTION This role adds C info to storage debugging output. @@ -31,7 +31,10 @@ Add C to debugging output. around '_query_start' => sub { my ($method, $self, $sql, @bind) = @_; my $dsn = $self->_dbi_connect_info->[0]; - $self->$method("DSN: $dsn SQL: $sql", @bind); + my($op, $rest) = (($sql=~m/^(\w+)(.+)$/),'NOP', 'NO SQL'); + my $storage_type = $self->can('active') ? 'REPLICANT' : 'MASTER'; + + $self->$method("$op [DSN_$storage_type=$dsn]$rest", @bind); }; =head1 ALSO SEE