[Dbix-class] ->deploy() trashes Log4perl configuration?

Adam Jacob adam at stalecoffee.org
Thu May 24 05:29:32 GMT 2007


On Thu, May 24, 2007 at 01:40:39PM +0930, Adrian Corston wrote:
>    Adrian Corston wrote:
> 
>      The following example code shows that Log4perl's configuration is being
>      trashed when calling ->deploy().  The failure behaviour is demonstrated
>      by the lack of a "debug after" debug message.
> 
>    mst says "if bits of SQLT fail please post patches to the DBIC list" so
>    here is patch and a test.
> *** SQL/Translator/Schema/Graph.pm       2007-01-11 15:48:18.000000000 +0000
> --- SQL/Translator/Schema/Graph.pm.fixed 2007-05-24 13:19:25.000000000 +0000
> ***************
> *** 5,12 ****
>   use Data::Dumper;
>   local $Data::Dumper::Maxdepth = 3;
>   
> ! use Log::Log4perl qw(:easy);
> ! Log::Log4perl->easy_init($ERROR);
>   use SQL::Translator::Schema::Graph::Node;
>   use SQL::Translator::Schema::Graph::Edge;
>   use SQL::Translator::Schema::Graph::Port;

This should probably be:

use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init($ERROR) unless Log::Log4perl->initialized;

It never hurts to add a test, either. :)

Adam

-- 
HJK Solutions - We Launch Startups - http://www.hjksolutions.com
Adam Jacob, Senior Partner
T: (206) 508-4759 E: adam at hjksolutions.com



More information about the Dbix-class mailing list