/[Sack]/trunk/lib/Sack/Color.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Sack/Color.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 154 by dpavlin, Wed Oct 7 20:42:46 2009 UTC revision 155 by dpavlin, Fri Oct 9 19:12:05 2009 UTC
# Line 16  sub BEGIN { Line 16  sub BEGIN {
16          $SIG{__WARN__} = sub {          $SIG{__WARN__} = sub {
17                  return unless @_;                  return unless @_;
18                  my $msg = join('', @_);                  my $msg = join('', @_);
19                  if ( $msg !~ m{[\n\r]$} ) {                  if ( $msg =~ s{ line (\d+)\.}{ +$1} ) {
20                          my @loc = caller(1);                          $msg =~ s{^(.+)( at .+)}{\e[31m$1\e[0m$2} if $msg !~ m{^#};
                         $msg .= " in $loc[1] +$loc[2]\n" if @loc;  
21                  }                  }
22                  $msg =~ s{\[(0|\d\d\d\d)\]}{ '[' . port2color($1) . ']' }eg;                  $msg =~ s{\[(0|\d\d\d\d)\]}{ '[' . port2color($1) . ']' }eg;
23                  print STDERR $msg unless $msg =~ m{^#} && ! $ENV{DEBUG};                  print STDERR $msg unless $msg =~ m{^#} && ! $ENV{DEBUG};

Legend:
Removed from v.154  
changed lines
  Added in v.155

  ViewVC Help
Powered by ViewVC 1.1.26