fix precedence for executing in new
[dbsrgits/SQL-Abstract.git] / lib / DBIx / Class / Storage / Debug / PrettyPrint.pm
index 8a8c659..44bae61 100644 (file)
@@ -19,10 +19,12 @@ sub new {
    my $args  = shift;
 
    my $clear_line = $args->{clear_line} || "\r\e[J";
-   my $executing  = $args->{executing}  || eval { require Term::ANSIColor } ? do {
-       my $c = \&Term::ANSIColor::color;
-       $c->('blink white on_black') . 'EXECUTING...' . $c->('reset');;
-   } : 'EXECUTING...';
+   my $executing  = $args->{executing}  || (
+      eval { require Term::ANSIColor } ? do {
+          my $c = \&Term::ANSIColor::color;
+          $c->('blink white on_black') . 'EXECUTING...' . $c->('reset');
+      } : 'EXECUTING...'
+   );
    my $show_progress = $args->{show_progress};
 
    my $squash_repeats = $args->{squash_repeats};
@@ -60,11 +62,11 @@ sub print {
   my $formatted;
   if ($self->squash_repeats && $self->_last_sql eq $string) {
      my ( $l, $r ) = @{ $sqlat->placeholder_surround };
-     $formatted = '... : ' . join(', ', map "$l$_$r", @$bindargs) . "\n";
+     $formatted = '... : ' . join(', ', map "$l$_$r", @$bindargs)
   } else {
      $self->_last_sql($string);
-     $formatted = $sqlat->format($string, $bindargs) . "\n";
-     $formatted = "$formatted: " . join ', ', @{$bindargs}
+     $formatted = $sqlat->format($string, $bindargs);
+     $formatted = "$formatted : " . join ', ', @{$bindargs}
         unless $use_placeholders;
   }