Loading ...
Sorry, an error occurred while loading the content.

How to easily turn on/off debugging information

Expand Messages
  • Byrne Reese
    One thing I find myself constantly doing with my SOAP::Lite clients is commenting in and out the +trace = debug from the use SOAP::Lite call so that I
    Message 1 of 2 , Apr 29 1:00 PM
    View Source
    • 0 Attachment
      One thing I find myself constantly doing with my SOAP::Lite clients is
      commenting in and out the "+trace => 'debug'" from the "use SOAP::Lite" call
      so that I can turn on and off debugging information. This became so annoying
      to me that I decided to programitize it. Now I just turn debugging on and
      off with a command line flag.

      The following code fragment shows how you can easily turn on and off
      SOAP::Lite debugging information from the command line. Obviating your need
      to go into the code everytime you want to toggle debugging:

      use Getopt::Long;
      my $result = GetOptions ("debug" => \$DEBUG);

      if ($DEBUG) {
      eval "use SOAP::Lite +trace => 'debug';";
      } else {
      eval "use SOAP::Lite;";
      }

      This is also available online at:
      http://www.majordojo.com/archives/2003_04.html#000012

      Byrne Reese
      Developer Program Manager
      Grand Central Communications, Inc.
      http://developer.grandcentral.com/
    • Randy J. Ray
      ... use SOAP::Lite; use Getopt::Long; my $result = GetOptions ( debug = $DEBUG); # No my for $DEBUG? :-) $DEBUG && SOAP::Lite- import(trace = debug);
      Message 2 of 2 , Apr 29 2:10 PM
      View Source
      • 0 Attachment
        > The following code fragment shows how you can easily turn on and off
        > SOAP::Lite debugging information from the command line. Obviating your need
        > to go into the code everytime you want to toggle debugging:
        >
        > use Getopt::Long;
        > my $result = GetOptions ("debug" => \$DEBUG);
        >
        > if ($DEBUG) {
        > eval "use SOAP::Lite +trace => 'debug';";
        > } else {
        > eval "use SOAP::Lite;";
        > }

        use SOAP::Lite;
        use Getopt::Long;
        my $result = GetOptions ("debug" => \$DEBUG); # No 'my' for $DEBUG? :-)

        $DEBUG && SOAP::Lite->import(trace => debug);


        Randy
        --
        rjray@... http://www.rjray.org http://www.svsm.org

        Any spammers auto-extracting addresses from this message will definitely want
        to include uce@... and report@...
      Your message has been successfully submitted and would be delivered to recipients shortly.