OSDN Git Service

debug flag
authorISHIKAWA Mutsumi <ishikawa@hanzubon.jp>
Mon, 22 Oct 2012 03:08:21 +0000 (12:08 +0900)
committerISHIKAWA Mutsumi <ishikawa@hanzubon.jp>
Mon, 22 Oct 2012 03:08:21 +0000 (12:08 +0900)
mubot4fb.pl

index 9148f93..a0c5987 100755 (executable)
@@ -67,10 +67,10 @@ sub remove {
 
        my $uri = $me->{fbo}->query->find($post_id)->uri_as_string;
        my $req = HTTP::Request::Common::DELETE($uri);
-       warn Dumper($req);
+       warn Dumper($req) if ($me->{cfg}->{debug});
        my $resp;
        $resp = LWP::UserAgent->new->request($req);
-       warn Dumper($resp);
+       warn Dumper($resp) if ($me->{cfg}->{debug});
        if ($resp->is_success && $resp->code == 200 && $resp->content eq 'true') {
                return 1;
        } else {
@@ -376,6 +376,7 @@ $cfg->{irc_nick} ||= 'mubot4fb';
 $cfg->{irc_name}||= $cfg->{irc_nick};
 $cfg->{irc_charset} ||= 'utf8';
 $cfg->{database} ||= 'mubot4fb';
+$cfg->{debug} ||= 0;
 
 my $bot = Mubot4FB->new(server => $cfg->{'irc_server'},
                        port => $cfg->{'irc_port'},