From: Dobrica Pavlinusic Date: Sat, 28 Jul 2012 18:59:37 +0000 (+0200) Subject: dump LWP with DEBUG=1 X-Git-Url: http://git.rot13.org/?p=ILL-Zotero-RT;a=commitdiff_plain;h=2df4ed6146b9fef5c869d920e0068f2c610d915a;hp=03812fc940bc2c03db3f82b620967e20087e8160 dump LWP with DEBUG=1 --- diff --git a/CouchDB.pm b/CouchDB.pm index 9512174..9f8cf56 100644 --- a/CouchDB.pm +++ b/CouchDB.pm @@ -15,6 +15,11 @@ sub new { $ua->timeout(10); $ua->env_proxy; + if ( $ENV{DEBUG} ) { + $ua->add_handler("request_send", sub { shift->dump; return }); + $ua->add_handler("response_done", sub { shift->dump; return }); + } + return bless { ua => $ua, host => $host,