Skip Menu |

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

Report information
The Basics
Id: 46631
Status: resolved
Priority: 0/
Queue: Log-Handler

People
Owner: Nobody in particular
Requestors: lespea [...] gmail.com
Cc:
AdminCc:

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



Subject: Message formatting breaks when creating multiple instances
I ran into an issue that when a module a I was using had an instances of Log::Handler and then a separate program create its own instance, the formatting in all but the original logging instances wouldn't be applied. TEST ==== I've attached my test script and the different output files that are generated. As you can see, the outputs in the various files are not correct (besides the first one).
Subject: t.zip
Download t.zip
application/x-zip-compressed 1.1k

Message body not shown because it is not plain text.

Hi, thanks for your report! Version 0.55_01 were released. Please test it and give me feedback! Cheers, Jonny
Hey thanks for the quick reply! I threw it on a linux VM I have laying around and it appears to work great! My main dev is on Wintel using ActiveState (sad I know, right) and I'm not sure how to install from source on there. I can't use Strawberry perl unfortunately so I'm sorta stuck testing it on windows. Otherwise this is awesome: I have a custom wrapper that I use around Log::Handler to quickly generate logger objects with standard formatting/etc and it makes logging quite pleasant! Thanks again :) ~Adam~
Hi Adam, Show quoted text
> I threw it on a linux VM I have laying around and it appears to work > great! My main dev is on Wintel using ActiveState (sad I know, right) > and I'm not sure how to install from source on there.
That should be esay! 1. open a dos box or any other shell 2. start a cpan shell perl -MCPAN -eshell 3. if the cpan shell is startet, install the new package Show quoted text
cpan> install BLOONIX/Log-Handler-0.55_01.tar.gz
If the package is not available you can try to install it from source: Download Log-Handler-0.55_01.tar.gz from CPAN. Unpack it and change the directory to Log-Handler-0.55_01. perl.exe Makefile.PL nmake nmake test nmake install Note that you need to install nmake15.exe for Windows if you want to install Perl-Modules from source. Look here: http://support.microsoft.com/kb/132084/en-us Show quoted text
> Otherwise this is awesome: I have a custom wrapper that I use around > Log::Handler to quickly generate logger objects with standard > formatting/etc and it makes logging quite pleasant!
A hint for you: do not create a lot of handler objects like $l1 = Log::Handler->new; $l1->add(file => $opts); $l2 = Log::Handler->new; $l2->add(file => $opts); $l3 = Log::Handler->new; $l3->add(file => $opts); It's comfortable to add all outputs to one object: $log = Log::Handler->new; $log->add( file => $opts1 ); $log->add( file => $opts2 ); $log->add( file => $opts3 ); Cheers and a nice weekend, Jonny
Oh great thanks I didn't know about nmake! I got this installed now and it's still working perfectly! I typically do write to multiple files the way you've suggested which is why it took a while for me to run across this bug. Recently however, I've been adding Log::Handler to my modules so that they log their output as well as whatever the calling script. Therefor the module has its own instance as well as the main script. I do this because it then makes debugging easy since each process has its own log file(s). Anyawy thanks again and I appreciate the help with ActiveState :)