r230@brr: dpavlin | 2007-11-18 17:42:53 +0100
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 18 Nov 2007 16:43:09 +0000 (16:43 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 18 Nov 2007 16:43:09 +0000 (16:43 +0000)
 hush debug output

git-svn-id: https://perl-cwmp.googlecode.com/svn/trunk@208 836a5e1a-633d-0410-964b-294494ad4392

lib/CWMP/Session.pm

index c9c1f1f..6256f57 100644 (file)
@@ -113,7 +113,7 @@ sub process_request {
 
        if ( $self->create_dump ) {
                write_file( $file, $r->as_string );
 
        if ( $self->create_dump ) {
                write_file( $file, $r->as_string );
-               warn "### request dumped to file: $file\n";
+               warn "### request dumped to file: $file\n" if $self->debug;
        }
 
        my $state;
        }
 
        my $state;
@@ -131,7 +131,7 @@ sub process_request {
                        symlink $file, $type || warn "can't symlink $file -> $type: $!";
                }
 
                        symlink $file, $type || warn "can't symlink $file -> $type: $!";
                }
 
-               warn "## acquired state = ", dump( $state ), "\n";
+               warn "## acquired state = ", dump( $state ), "\n" if $self->debug;
 
                if ( ! defined( $state->{DeviceID} ) ) {
                        warn "## state with DeviceID, using old one...\n";
 
                if ( ! defined( $state->{DeviceID} ) ) {
                        warn "## state with DeviceID, using old one...\n";
@@ -216,7 +216,7 @@ sub dispatch {
                if ( $self->create_dump ) {
                        my $file = sprintf("dump/%04d-%s.response", $dump_nr++, $self->sock->peerhost);
                        write_file( $file, $xml );
                if ( $self->create_dump ) {
                        my $file = sprintf("dump/%04d-%s.response", $dump_nr++, $self->sock->peerhost);
                        write_file( $file, $xml );
-                       warn "### response dump: $file\n";
+                       warn "### response dump: $file\n" if $self->debug;
                }
                return $xml;
        } else {
                }
                return $xml;
        } else {