Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the RDF-Trine CPAN distribution.

Report information
The Basics
Id: 69254
Status: open
Priority: 0/
Queue: RDF-Trine

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

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



Subject: Log4perl initialization
Hi Gregory, I've been using your RDF::Trine and it's pretty awesome. I noticed that you initialize Log4perl at the top of Trine.pm: use Log::Log4perl qw(:easy); Log::Log4perl->easy_init($ERROR); I think this is probably a mistake. If an application includes one of your Trine modules, it will wipe out their Log4perl configuration. This is what was happening to me and it took me a while to figure it out. Instead, I think you can just do: use Log::Log4perl; If I am not mistaken, Log4perl just print a warning if you try to log something and Log4perl hasn't been initialized yet. Keep up the great work! -- Ben
On Sun Jul 03 15:38:18 2011, SADI wrote: Show quoted text
> > I noticed that you initialize Log4perl at the top of Trine.pm: > > use Log::Log4perl qw(:easy); > Log::Log4perl->easy_init($ERROR); > > I think this is probably a mistake. If an application includes one of > your Trine modules, it will wipe out their Log4perl configuration. This > is what was happening to me and it took me a while to figure it out. > > Instead, I think you can just do: > > use Log::Log4perl; > > If I am not mistaken, Log4perl just print a warning if you try to log > something and Log4perl hasn't been initialized yet. > > Keep up the great work! > > -- Ben
Hi Ben, Thanks for the bug report. I admit I don't have a very deep knowledge of Log4perl beyond the simple logging I'm doing. It sounds like obviously I need to make a change. The reason I had put the initialization code in RDF::Trine originally was that I don't want to burden every user of my code to either have to explicitly initialize the logging or suffer from meaningless warnings about the lack of initialization. Do you know if there's a way to satisfy these concerns with Log4perl? If not, I'll try to dig around for a solution and try to get changes into the next release of RDF::Trine. thanks, .greg