Skip Menu |

This queue is for tickets about the Log-Log4perl CPAN distribution.

Report information
The Basics
Id: 75655
Status: resolved
Priority: 0/
Queue: Log-Log4perl

People
Owner: Nobody in particular
Requestors: meir [...] guttman.co.il
Cc:
AdminCc:

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



Subject: Log::Log4perl::Appender::ScreenColoredLevels
Date: Fri, 09 Mar 2012 23:23:51 +0200
To: bug-Log-Log4perl [...] rt.cpan.org
From: Meir Guttman <meir [...] guttman.co.il>
Dear Michael, First and foremost, thank you for a most useful set of modules! With regard to the Log::Log4perl::Appender::ScreenColoredLevels, I would like to point two issues: 1) A documentation issue: I would add that on "Windows" systems, the "Win32::Console::ANSI" module is required. 2) A real(?) bug: On windows, even with the above module, it seems that setting screen attributes doesn't work. All colors and other attributes remain the default Test: use strict; use warnings; use Log::Log4perl qw(get_logger :levels); use Win32::Console::ANSI; my $config_str = q( log4perl.rootLogger = DEBUG, FileLogger, ScreenLogger log4perl.appender.ScreenLogger = Log::Log4perl::Appender::ScreenColoredLevels log4perl.appender.ScreenLogger.stderr = 0 ##### The following doesn't seem to work: log4perl.appender.Screen.color = {fatal => bold cyan} ##### log4perl.appender.ScreenLogger.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.ScreenLogger.layout.ConversionPattern = %m %n log4perl.appender.FileLogger = Log::Log4perl::Appender::File log4perl.appender.FileLogger.filename = mylog.txt log4perl.appender.FileLogger.mode = append log4perl.appender.FileLogger.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.FileLogger.layout.ConversionPattern = %d{HH:MM:SS} %F{1}:%L %m %n log4perl.appender.ScreenLogger.Threshold = WARN ); Log::Log4perl->init(\$config_str); my $logger = Log::Log4perl->get_logger(); $logger->debug("This is a DEBUG line"); $logger->error("And this is an ERROR log message"); $logger->fatal("And this is FATAL!"); (I am too much of a newbie to supply a patch. Believe me, prior attempts (with other modules) ended miserably ... :-( ) Regards, Meir Guttman Ashdod, Israel
Hi Meir, thanks for reporting this, we don't get a lot of Windows users around here :). Your comment on requiring Win32::Console::ANSI is spot-on, I've added it to the docs: https://github.com/mschilli/log4perl/commit/ca53e0a817cb3cf88df7dede0d79 23655b7b9252 After that, it works fine for me with Log::Log4perl 1.36 and Strawberry perl 5.10.1 on Windows 7: http://perlmeister.com/tmp/l4p-win32-color.jpg Are you running the latest version? -- Mike
Subject: RE: [rt.cpan.org #75655] Log::Log4perl::Appender::ScreenColoredLevels
Date: Sat, 10 Mar 2012 16:27:52 +0200
To: bug-Log-Log4perl [...] rt.cpan.org
From: Meir Guttman <meir [...] guttman.co.il>
Hi Mike, Show quoted text
> -----Original Message----- > From: Michael_Schilli via RT [mailto:bug-Log-Log4perl@rt.cpan.org] > Sent: Saturday, March 10, 2012 6:43 AM > To: meir@guttman.co.il > Subject: [rt.cpan.org #75655] > Log::Log4perl::Appender::ScreenColoredLevels > > <URL: https://rt.cpan.org/Ticket/Display.html?id=75655 > > > Hi Meir, > > thanks for reporting this, we don't get a lot of Windows users around > here :).
Well, I can sympathized with you, but old habits (45+ years, starting with the IBM-1130 http://www.ibm1130.net/) die hard and as it is, I have so much to learn that adding Linux to the fry seems way down on priority :-(. Show quoted text
> Your comment on requiring Win32::Console::ANSI is spot-on, > I've added it to the docs: > > https://github.com/mschilli/log4perl/commit/ca53e0a817cb3cf88df7dede0d7 > 9 > 23655b7b9252
Glad I could help! It isn't very often that I can do such... Show quoted text
> > After that, it works fine for me with Log::Log4perl 1.36 and Strawberry > perl 5.10.1 on Windows 7: > > http://perlmeister.com/tmp/l4p-win32-color.jpg > > Are you running the latest version?
our $VERSION (pun intended...) * Log::Log4Perl Ver. 1.36, * Win32::Console::ANSI Ver. 1.04 * ActivePerl Ver. 5.10.1 * on Win-XP (32-bits) SP3 with all the latest updates. I must add that my screen shows exactly the same colors as in your sample. So far so good, BUT! These are the default colors. Please try though to set something out of the ordinary such as "bold cyan on_white". On my machine it didn't change a thing, neither did anything else! And one other thing: I use in another script the lovely Audrey Tangs's other ANSI module, Term::ANSIScreen. There I could set any ANSIScreen supported color and attribute. (That's what gave me the idea to try Win32::Console::ANSI in the first place.) I also tried to "use Term::ANSIColor;" (Ver. 3.01), no change! So, there you are! Regards Meir Show quoted text
> > -- Mike > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 9.0.927 / Virus Database: 271.1.1/4261 - Release Date: > 03/09/12 21:34:00
Think you're using "Screen" where you want to say "ScreenLogger" in your Log4perl config file. I tried: http://perlmeister.com/tmp/win32-2.jpg and got http://perlmeister.com/tmp/win32-1.jpg which looks exactly like advertised. Give it a try! -- Mike
Subject: RE: [rt.cpan.org #75655] Log::Log4perl::Appender::ScreenColoredLevels
Date: Sun, 11 Mar 2012 10:21:26 +0200
To: bug-Log-Log4perl [...] rt.cpan.org
From: Meir Guttman <meir [...] guttman.co.il>
Hi Mike, Show quoted text
> > Think you're using "Screen" where you want to say "ScreenLogger" in > your Log4perl config file. >
Oh God (blush, blush!) Of course! And looking at it now, it is so obvious...! How could I miss it?! Many, many thanks and sorry for wasting your time ... Meir
No worries, I'm glad it works for you! ;)