Devel::Events::Handler::Log::Memory - An optional base role for event generators.
use Devel::Events::Handler::Log::Memory; my $log = Devel::Events::Handler::Log::Memory->new(); Some::Geneator->new( handler => $log );
This convenience role provides a basic send_event method, useful for implementing generators.
send_event
The list of events.
Auto derefs.
The Devel::Events::Match instance used for event matching.
Remove all events from the log.
Provided by MooseX::AttributeHelpers.
Return the first event that matches a certain condition.
Delegates to Devel::Events::Match.
Return the list of events that match a certain condition.
Return events between two events. If if from or to is omitted then it returns all the events up to or from the other filter.
from
to
Cuts the event log into chunks. When $marker matches a new chunk is opened.
$marker
Log the event to the events list by calling add_event.
events
add_event
Replay all the events in the log to $handler.
Useful if $handler does heavy analysis that you want to delay.
$handler
There isn't much to it:
$handler->new_event(@$_) for $self->events;
So obviously you can replay subsets of events manually.
If any references are present in the event data then they will be preserved till the log is clear. This may cause leaks.
To overcome this problem use Devel::Events::Filter::Stringify. It will not allow overloading unless asked to, so it's safe to use without side effects.
Add an option to always hash all the event data for convenience.
Make grep and limit into exportable functions, too.
grep
limit
To install Devel::Events, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Devel::Events
CPAN shell
perl -MCPAN -e shell install Devel::Events
For more information on module installation, please visit the detailed CPAN module installation guide.