From e45669f55ca20c109ef16a2e354de77992850ab8 Mon Sep 17 00:00:00 2001 From: Timofey Potapov Date: Fri, 24 May 2024 12:13:46 +0200 Subject: [PATCH] 1.15 - Updated "watch" with -methods option. --- Build.PL | 2 +- Changes | 7 +++++++ lib/e.pm | 30 +++++++++++++++++++++++------- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/Build.PL b/Build.PL index 6751537..e8b1931 100755 --- a/Build.PL +++ b/Build.PL @@ -47,7 +47,7 @@ my $builder = $class->new( 'perl' => '5.016', 'Sub::Util' => '0', 'Runtime::Debugger' => '1.02', - 'Data::Trace' => '1.03', + 'Data::Trace' => '1.04', 'Tiny::Prof' => '0', 'Mojolicious' => '0', 'YAML::XS' => '0', diff --git a/Changes b/Changes index e165b4a..8bc268e 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,12 @@ Revision history for e +================= +1.15 - 2024-05-24 +================= + +Updated "watch" with -methods option to make it simple to +watch only specific methods (like "fetch"). + ================= 1.14 2024-05-24 ================= diff --git a/lib/e.pm b/lib/e.pm index aa315af..05844fb 100644 --- a/lib/e.pm +++ b/lib/e.pm @@ -23,7 +23,7 @@ package e; / / / / __ \/ / _ \/ __ `/ ___/ __ \/ _ \/ __ / / /_/ / / / / / __/ /_/ (__ ) / / / __/ /_/ / \__,_/_/ /_/_/\___/\__,_/____/_/ /_/\___/\__,_/ - + =head1 NAME e - beastmode unleashed @@ -34,7 +34,7 @@ use 5.006; use strict; use warnings; -our $VERSION = '1.14'; +our $VERSION = '1.15'; =head1 SYNOPSIS @@ -133,21 +133,37 @@ Enable to analyze code in the process. Show a stack trace. - trace( $depth=1 ) + trace( $depth=1 ) =head2 watch Watch a reference for changes. - watch( $ref, $depth=3 ) + watch( $ref, OPTIONS ) + +OPTIONS: + + -clone => 0, # Will not watch cloned objects. + + -methods => "fetch", # Monitor just this method. + -methods => [ "fetch" ], # Same. + + -levels => NUM, # How many scope levels to show. + NUM, # Same. + + -raw => 1, # Include internal calls. + -NUM, # Same. + + -message => STR, # Message to display. + STR, # Same. =head2 prof Profile the code from this point on. - my $obj = prof; - ... - # $obj goes out of scope and builds results. + my $obj = prof; + ... + # $obj goes out of scope and builds results. =head2 j