Skip Menu |

This queue is for tickets about the MooseX-FollowPBP CPAN distribution.

Report information
The Basics
Id: 65429
Status: resolved
Priority: 0/
Queue: MooseX-FollowPBP

People
Owner: Nobody in particular
Requestors: christian.kuelker [...] cipworx.org
Cc:
AdminCc:

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



Subject: You are overwriting a locally defined function (get_logger) with an accessor
Date: Fri, 04 Feb 2011 21:16:51 +0900
To: bug-moosex-followpbp [...] rt.cpan.org
From: Christian Kuelker <christian.kuelker [...] cipworx.org>
Dear Dave Rolsky, thank you for writing MooseX::FollowPBP! I use MooseX::FollowPBP often, but together with MooseX logging (Log::Log4perl and Log::Dispatch) I got always the error "You are overwriting a locally defined function (get_logger) with an accessor". I boiled it down and attached 2 files basically the synopsis of MooseX::Log::Log4perl::Easy. By using your class the error occurs, without it do not. BR Christian The complete error message is: ./myapp.pl You are overwriting a locally defined function (get_logger) with an accessor at /usr/lib/perl5/Moose/Meta/Attribute.pm line 563 Moose::Meta::Attribute::_process_accessors('Class::MOP::Class::__ANON__::SERIAL::1=HASH(0xa6af580)', 'reader', 'get_logger', undef) called at /usr/lib/perl5/Class/MOP/Attribute.pm line 358 Class::MOP::Attribute::install_accessors('Class::MOP::Class::__ANON__::SERIAL::1=HASH(0xa6af580)') called at /usr/lib/perl5/Moose/Meta/Attribute.pm line 529 Moose::Meta::Attribute::install_accessors('Class::MOP::Class::__ANON__::SERIAL::1=HASH(0xa6af580)') called at /usr/lib/perl5/Class/MOP/Class.pm line 717 Class::MOP::Class::__ANON__() called at /usr/share/perl5/Try/Tiny.pm line 76 eval {...} called at /usr/share/perl5/Try/Tiny.pm line 67 Try::Tiny::try('CODE(0xa6af6c0)', 'Try::Tiny::Catch=REF(0xa6a5bd0)') called at /usr/lib/perl5/Class/MOP/Class.pm line 722 Class::MOP::Class::_post_add_attribute('Moose::Meta::Class=HASH(0xa45d1d8)', 'Class::MOP::Class::__ANON__::SERIAL::1=HASH(0xa6af580)') called at /usr/lib/perl5/Class/MOP/Mixin/HasAttributes.pm line 45 Class::MOP::Mixin::HasAttributes::add_attribute('Moose::Meta::Class=HASH(0xa45d1d8)', 'Class::MOP::Class::__ANON__::SERIAL::1=HASH(0xa6af580)') called at /usr/lib/perl5/Moose/Meta/Class.pm line 304 Moose::Meta::Class::add_attribute('Moose::Meta::Class=HASH(0xa45d1d8)', 'Class::MOP::Class::__ANON__::SERIAL::1=HASH(0xa6af580)') called at /usr/lib/perl5/Moose/Meta/Role/Application/ToClass.pm line 142 Moose::Meta::Role::Application::ToClass::apply_attributes('Moose::Meta::Role::Application::ToClass=HASH(0xa229e98)', 'Moose::Meta::Role=HASH(0xa6a2f00)', 'Moose::Meta::Class=HASH(0xa45d1d8)') called at /usr/lib/perl5/Moose/Meta/Role/Application.pm line 72 Moose::Meta::Role::Application::apply('Moose::Meta::Role::Application::ToClass=HASH(0xa229e98)', 'Moose::Meta::Role=HASH(0xa6a2f00)', 'Moose::Meta::Class=HASH(0xa45d1d8)') called at /usr/lib/perl5/Moose/Meta/Role/Application/ToClass.pm line 31 Moose::Meta::Role::Application::ToClass::apply('Moose::Meta::Role::Application::ToClass=HASH(0xa229e98)', 'Moose::Meta::Role=HASH(0xa6a2f00)', 'Moose::Meta::Class=HASH(0xa45d1d8)', 'HASH(0xa6a5c00)') called at /usr/lib/perl5/Moose/Meta/Role.pm line 416 Moose::Meta::Role::apply('Moose::Meta::Role=HASH(0xa6a2f00)', 'Moose::Meta::Class=HASH(0xa45d1d8)') called at /usr/lib/perl5/Moose/Util.pm line 133 Moose::Util::_apply_all_roles('Moose::Meta::Class=HASH(0xa45d1d8)', undef, 'MooseX::Log::Log4perl::Easy') called at /usr/lib/perl5/Moose/Util.pm line 87 Moose::Util::apply_all_roles('Moose::Meta::Class=HASH(0xa45d1d8)', 'MooseX::Log::Log4perl::Easy') called at /usr/lib/perl5/Moose.pm line 58 Moose::with('Moose::Meta::Class=HASH(0xa45d1d8)', 'MooseX::Log::Log4perl::Easy') called at /usr/lib/perl5/Moose/Exporter.pm line 294 Moose::with('MooseX::Log::Log4perl::Easy') called at MyApp.pm line 6 require MyApp.pm called at ./myapp.pl line 4 main::BEGIN() called at MyApp.pm line 0 eval {...} called at MyApp.pm line 0 Can't locate object method "logger" via package "MyApp" at /usr/local/share/perl/5.10.1/MooseX/Log/Log4perl/Easy.pm line 13.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #65429] You are overwriting a locally defined function (get_logger) with an accessor
Date: Thu, 3 Feb 2011 14:23:58 -0600 (CST)
To: Christian Kuelker via RT <bug-MooseX-FollowPBP [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Thu, 3 Feb 2011, Christian Kuelker via RT wrote: Show quoted text
> I use MooseX::FollowPBP often, but together with MooseX logging > (Log::Log4perl and Log::Dispatch) I got always the error "You are > overwriting a locally defined function (get_logger) with an > accessor". I boiled it down and attached 2 files basically the > synopsis of MooseX::Log::Log4perl::Easy. By using your class the > error occurs, without it do not.
This doesn't really have anything to do with this module. Somehow you're defining get_logger twice, once as an accessor and once as a subroutine: has logger => ( ... ); sub get_logger { ... } The fix is simple. Don't do that. -dave /*============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================*/
Subject: Re: [rt.cpan.org #65429] You are overwriting a locally defined function (get_logger) with an accessor
Date: Fri, 04 Feb 2011 22:33:46 +0900
To: bug-MooseX-FollowPBP [...] rt.cpan.org
From: Christian Kuelker <christian.kuelker [...] cipworx.org>
On 02/04/2011 05:24 AM, autarch@urth.org via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=65429 > > > On Thu, 3 Feb 2011, Christian Kuelker via RT wrote: >
>> I use MooseX::FollowPBP often, but together with MooseX logging >> (Log::Log4perl and Log::Dispatch) I got always the error "You are >> overwriting a locally defined function (get_logger) with an >> accessor". I boiled it down and attached 2 files basically the >> synopsis of MooseX::Log::Log4perl::Easy. By using your class the >> error occurs, without it do not.
> > This doesn't really have anything to do with this module. Somehow you're > defining get_logger twice, once as an accessor and once as a subroutine: > > has logger => ( ... ); > > sub get_logger { ... } > > The fix is simple. Don't do that.
Thank you for clarifying this! Since I am not the author of MooseX::Log::Log4perl and MooseX::LogDispatch the only choice is not to use your module if I would like to have an advanced logging facility. You might consider adding this modules to an incompatibility list? I investigated further: MooseX::Log::Log4perl - has 'logger' Log::Log4perl - sub get_logger MooseX::LogDispatch - Can't locate object method "logger" However, it seems obvious that your module changes the behavior of class methods other then the file in witch MooseX::FollowPBP was included. This might not even be the fault of MooseX::FollowPBP. But if MooseX::FollowPBP do not respect the scope it is supplied, I would vote against using it. Should I file this bug against MooseX::Log::Log4perl, MooseX::LogDispatch? BR Christian
Subject: Re: [rt.cpan.org #65429] You are overwriting a locally defined function (get_logger) with an accessor
Date: Thu, 3 Feb 2011 15:55:18 -0600 (CST)
To: Christian Kuelker via RT <bug-MooseX-FollowPBP [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Thu, 3 Feb 2011, Christian Kuelker via RT wrote: Show quoted text
> MooseX::Log::Log4perl - has 'logger' > Log::Log4perl - sub get_logger > > MooseX::LogDispatch - Can't locate object method "logger" > > However, it seems obvious that your module changes the behavior of > class methods other then the file in witch MooseX::FollowPBP > was included. This might not even be the fault of MooseX::FollowPBP. > > But if MooseX::FollowPBP do not respect the scope it is supplied, I > would vote against using it.
This is a bug in Moose itself, and will be fixed in Moose 2.0. In Moose 2.0, modules like MX::FollowPBP will not change the names of accessors generated by attributes from roles, unless those roles _also_ use MX::FollowPBP. -dave /*============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================*/
Subject: Re: [rt.cpan.org #65429] You are overwriting a locally defined function (get_logger) with an accessor
Date: Thu, 03 Feb 2011 23:19:20 +0100
To: bug-MooseX-FollowPBP [...] rt.cpan.org
From: Christian Kuelker <christian.kuelker [...] cipworx.org>
On 02/03/2011 10:55 PM, autarch@urth.org via RT wrote: Show quoted text
Show quoted text
> This is a bug in Moose itself, and will be fixed in Moose 2.0. In Moose > 2.0, modules like MX::FollowPBP will not change the names of accessors > generated by attributes from roles, unless those roles _also_ use > MX::FollowPBP.
Thank you! That explains a lot ... BR Christian