summaryrefslogtreecommitdiffstats
path: root/lib/Carp/Always/Color.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Carp/Always/Color.pm')
-rw-r--r--lib/Carp/Always/Color.pm31
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