Skip Menu |

This queue is for tickets about the Log-Any-Adapter-ScreenColoredLevel CPAN distribution.

Report information
The Basics
Id: 80685
Status: resolved
Worked: 14 min
Priority: 0/
Queue: Log-Any-Adapter-ScreenColoredLevel

People
Owner: Nobody in particular
Requestors: MDORMAN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.03
Fixed in: (no value)



Subject: Unnecessary calls to Term::ANSIColor (and corresponding undefined error)
When logging at the debugging level, I was seeing these sorts of errors: Use of uninitialized value in concatenation (.) or string at /usr/share/perl/5.14/Term/ANSIColor.pm line 244, <STDIN> line 1. postgresql service stopping Use of uninitialized value in concatenation (.) or string at /usr/share/perl/5.14/Term/ANSIColor.pm line 244, <STDIN> line 1. Looking at the code, it would seem to be because of the lack of a color value for that logging level. It seems to me that the most sensible thing to do (which is also what the Log4perl adapter does), is not hit Term::ANSIColor at all if there's nothing to do. I have attached a patch that does this. So it should be both a little faster and a little more correct. ;)
Subject: undefined
Download undefined
application/octet-stream 809b

Message body not shown because it is not plain text.

So apparently Term::ANSIColor::color() will return undef if given code "". Have never seen the warning so far because I usually use "use warnings" instead of enabling warnings globally via -w. Applied, thanks. Regards, Steven On Wed Nov 07 09:13:56 2012, MDORMAN wrote: Show quoted text
> When logging at the debugging level, I was seeing these sorts of
errors: Show quoted text
> > Use of uninitialized value in concatenation (.) or string at > /usr/share/perl/5.14/Term/ANSIColor.pm line 244, <STDIN> line 1. > postgresql service stopping > Use of uninitialized value in concatenation (.) or string at > /usr/share/perl/5.14/Term/ANSIColor.pm line 244, <STDIN> line 1. > > Looking at the code, it would seem to be because of the lack of a
color Show quoted text
> value for that logging level. > > It seems to me that the most sensible thing to do (which is also what
the Show quoted text
> Log4perl adapter does), is not hit Term::ANSIColor at all if there's > nothing to do. I have attached a patch that does this. So it should
be Show quoted text
> both a little faster and a little more correct. ;)