Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by bellaire (Hermit)
on Aug 06, 2010 at 12:46 UTC ( #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
Node Status?
node history
Node Type: note [id://853395]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2019-10-23 21:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?