Skip to main content

Introducing LWP::ConsoleLogger::Everywhere

·157 words·1 min·
perl LWP::ConsoleLogger LWP::ConsoleLogger::Everywhere
❤️ It's great to see you here! I'm currently available on evenings and weekends for consulting and freelance work. Let's chat about how I can help you achieve your goals.

In an earlier post, I introduced you to LWP::ConsoleLogger. I’ve been using it heavily since then, but one thing I didn’t tackle was how to debug a user agent you can’t easily get it. Some modules don’t provide a public API which allows you to access their user agent. Or, maybe the user agent which you want to debug is so far removed from your code that you can’t easily access its public API. Previously, this was not an easy problem to solve. However, this is no longer the case. simbabque was kind enough to write LWP::ConsoleLogger::Everywhere.

It’s quite simple to use.

use LWP::ConsoleLogger::Everywhere;

Simply add this line to your code and run it. Any objects of the LWP::UserAgent family should now dump extensive logging information to your terminal. It can get a bit fancier than that, but this is really all you need to know in order to get started debugging 3rd party LWP::UserAgent-based HTTP requests.


Related

UserAgent Debugging Made Easy
·2689 words·13 mins
CPAN perl LWP::ConsoleLogger LWP::UserAgent UserAgent
The Perl QA Hackathon is still looking for Sponsors
·310 words·2 mins
CPAN metacpan perl QA Hackathon
MetaCPAN Welcomes Panopta as a Sponsor
·355 words·2 mins
CPAN metacpan perl sponsor