Skip to content

Instantly share code, notes, and snippets.

@ktat
Created June 8, 2012 03:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ktat/2893362 to your computer and use it in GitHub Desktop.
Save ktat/2893362 to your computer and use it in GitHub Desktop.
DBIx::QueryLog add_skip_packages patch
diff --git a/lib/DBIx/QueryLog.pm b/lib/DBIx/QueryLog.pm
index 747cdd5..cf5e379 100644
--- a/lib/DBIx/QueryLog.pm
+++ b/lib/DBIx/QueryLog.pm
@@ -8,6 +8,7 @@ use DBI;
use Time::HiRes qw(gettimeofday tv_interval);
use Term::ANSIColor qw(colored);
use Data::Dumper ();
+use Module::Find ();
$ENV{ANSI_COLORS_DISABLED} = 1 if $^O eq 'MSWin32';
@@ -90,6 +91,14 @@ for my $accessor (qw{
};
}
+sub add_skip_packages {
+ my ($self, @modules) = @_;
+ %SKIP_PKG_MAP = (
+ (map {$_ => 1, map {$_ => 1} Module::Find::findallmod($_) } @modules),
+ %SKIP_PKG_MAP,
+ );
+}
+
sub _st_execute {
my ($class, $org) = @_;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment