cvsuser     02/07/24 12:56:25

  Modified:    P5EEx/Blue/P5EEx/Blue Context.pm
  Log:
  debugging support moved to base class from Context::CGI
  
  Revision  Changes    Path
  1.34      +23 -1     p5ee/P5EEx/Blue/P5EEx/Blue/Context.pm
  
  Index: Context.pm
  ===================================================================
  RCS file: /cvs/public/p5ee/P5EEx/Blue/P5EEx/Blue/Context.pm,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -w -r1.33 -r1.34
  --- Context.pm        12 Jul 2002 21:05:43 -0000      1.33
  +++ Context.pm        24 Jul 2002 19:56:25 -0000      1.34
  @@ -1,6 +1,6 @@
   
   #############################################################################
  -## $Id: Context.pm,v 1.33 2002/07/12 21:05:43 spadkins Exp $
  +## $Id: Context.pm,v 1.34 2002/07/24 19:56:25 spadkins Exp $
   #############################################################################
   
   package P5EEx::Blue::Context;
  @@ -209,6 +209,28 @@
           $self->{config} = P5EEx::Blue::P5EE->new($config_class, "new", \%args);
       };
       $self->add_message($@) if ($@);
  +
  +    #################################################################
  +    # DEBUGGING
  +    #################################################################
  +
  +    # Supports the following command-line usage:
  +    #    -debug=1                                                (global debug)
  +    #    -debug=1,P5EEx::Blue::Context                       (debug class only)
  +    #    -debug=3,P5EEx::Blue::Context,P5EEx::Blue::Session  (multiple classes)
  +    #    -debug=6,P5EEx::Blue::Repository::DBI.select_rows (individual methods)
  +    my ($debug, $pkg);
  +    $debug = $args{debug};
  +    if (defined $debug && $debug ne "") {
  +        if ($debug =~ s/^([0-9]+),?//) {
  +            $P5EEx::Blue::DEBUG = $1;
  +        }
  +        if ($debug) {
  +            foreach $pkg (split(/,/,$debug)) {
  +                $self->{debugscope}{$pkg} = 1;
  +            }
  +        }
  +    }
   
       $self->init(\%args);
   
  
  
  


Reply via email to