Created
June 24, 2015 09:35
-
-
Save augensalat/6a1fe8647c3d009a2385 to your computer and use it in GitHub Desktop.
extended debugging for Mojo::EventEmitter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/lib/Mojo/EventEmitter.pm | |
+++ b/lib/Mojo/EventEmitter.pm | |
@@ -12,7 +12,11 @@ sub emit { | |
if (my $s = $self->{events}{$name}) { | |
warn "-- Emit $name in @{[blessed $self]} (@{[scalar @$s]})\n" if DEBUG; | |
- for my $cb (@$s) { $self->$cb(@_) } | |
+ my $i = 0; | |
+ for my $cb (@$s) { | |
+ warn "xx call cb #@{[$i++]} $name in @{[blessed $self]}\n" if DEBUG; | |
+ $self->$cb(@_); | |
+ } | |
} | |
else { | |
warn "-- Emit $name in @{[blessed $self]} (0)\n" if DEBUG; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment