diff options
author | Jesse Luehrs <doy@tozt.net> | 2010-04-30 17:45:24 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2010-04-30 17:45:24 -0500 |
commit | de72f280ecfd277f66c347a12c965893b1cb2500 (patch) | |
tree | 13015763e0db45520c8b572ca6b49727a3b26e72 /lib/Carp/Always/Color.pm | |
parent | d60d7381649bcdb3b34b21ed680c9c8ffa5e6966 (diff) | |
download | carp-always-color-de72f280ecfd277f66c347a12c965893b1cb2500.tar.gz carp-always-color-de72f280ecfd277f66c347a12c965893b1cb2500.zip |
docs
Diffstat (limited to 'lib/Carp/Always/Color.pm')
-rw-r--r-- | lib/Carp/Always/Color.pm | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/lib/Carp/Always/Color.pm b/lib/Carp/Always/Color.pm index 9c58978..00d9c1e 100644 --- a/lib/Carp/Always/Color.pm +++ b/lib/Carp/Always/Color.pm @@ -1,25 +1,33 @@ package Carp::Always::Color; +BEGIN { + if (-t *STDERR) { + require Carp::Always::Color::Term; + } + else { + require Carp::Always::Color::HTML; + } +} =head1 NAME -Carp::Always::Color - +Carp::Always::Color - Carp::Always, but with color =head1 SYNOPSIS + use Carp::Always::Color; -=head1 DESCRIPTION +or + perl -MCarp::Always::Color -e'sub foo { die "foo" } foo()' -=cut +=head1 DESCRIPTION -BEGIN { - if (-t *STDERR) { - require Carp::Always::Color::Term; - } - else { - require Carp::Always::Color::HTML; - } -} +Stack traces are hard to read when the messages wrap, because it's hard to tell +when one message ends and the next message starts. This just colors the first +line of each stacktrace, based on whether it's a warning or an error. If +messages are being sent to a terminal, it colors them with terminal escape +codes, otherwise it colors them with HTML (ideas for more intelligent behavior +here are welcome). =head1 BUGS @@ -31,6 +39,7 @@ L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Carp-Always-Color>. =head1 SEE ALSO +L<Carp::Always> =head1 SUPPORT |