Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Best way to share logging object among multiple objects?

by bellaire (Hermit)
on Aug 06, 2010 at 12:46 UTC ( [id://853395]=note: print w/replies, xml ) Need Help??


in reply to Best way to share logging object among multiple objects?

Probably use Moose roles and have the Tests and Actions ask their own Examiner for the dispatcher in the role method, rather than having the dispatcher be contained by the tests and actions themselves. Assuming they know their examiners, something like:
package Logging; #the role use Moose::Role; requires 'examiner'; # ask my examiner, rather than contain this directly. sub dispatcher { return $self->examiner->dispatcher(); } package MyTest; # the test class use Moose; with 'Logging'; #...later... $self->dispatcher->warn("this example might work?");

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-26 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found