Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: apply_all_roles method clobbering MooseX::Log::Log4perl

by 1nickt (Canon)
on Jan 18, 2018 at 15:43 UTC ( [id://1207470]=note: print w/replies, xml ) Need Help??


in reply to apply_all_roles method clobbering MooseX::Log::Log4perl

Don't you need a closing brace at the end of your BUILD sub? (Edit fixed in OP via ninja edit)

Why are you not consuming BarCollector with with as you do with the logger?

Hope this helps!


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^2: apply_all_roles method clobbering MooseX::Log::Log4perl
by nysus (Parson) on Jan 18, 2018 at 15:46 UTC

    Bracket was accidentally not pasted in. It is not added with 'with' because it would typically be conditionally added. I didn't show that logic because it's not pertinent to the question.

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest";
    $nysus = $PM . ' ' . $MCF;
    Click here if you love Perl Monks

      I have not used Log4Perl nor do I use Moose any more. However, I use Role::Tiny and Moo, and when you apply a Role to an object manually, the object is reblessed into the resultant class, which will have a name something like 'Foo::Bar_WITH_Bar::Baz', so if your logger config is dependent on the class name, that could be the source of the problem.

      Things I would think are "pertinent to the question":

      • Does the same behaviour occur when you consume the role with with?
      • Does the same behaviour occur when you apply the role elsewhere than in the BUILD sub? E.g. using after BUILD?
      • Does the same behaviour occur when you create a minimalist test case?
      • Does the same behaviour occur when using Role::Tiny::apply_roles_to_object?
      • Does the same behaviour occur when testing with a role other than the Log4Perl one?

      Hope this helps!


      The way forward always starts with a minimal test.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1207470]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2024-04-23 19:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found