Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package perl-LWP-ConsoleLogger for
openSUSE:Factory checked in at 2026-11-06 19:43:52
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-LWP-ConsoleLogger (Old)
and /work/SRC/openSUSE:Factory/.perl-LWP-ConsoleLogger.new.3759290 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-LWP-ConsoleLogger"
Fri Nov 6 19:43:52 2026 rev:7 rq:1395149 version:1.000003
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-LWP-ConsoleLogger/perl-LWP-ConsoleLogger.changes
2026-06-10 16:18:31.771813988 +0200
+++
/work/SRC/openSUSE:Factory/.perl-LWP-ConsoleLogger.new.3759290/perl-LWP-ConsoleLogger.changes
2026-11-06 19:49:45.083515969 +0100
@@ -1,0 +2,21 @@
+Sat Sep 19 09:33:35 UTC 2026 - Tina Müller <[email protected]>
+
+- updated to 1.000003
+ see /usr/share/doc/packages/perl-LWP-ConsoleLogger/Changes
+
+ 1.000003 2026-09-18 14:14:21Z
+ - Add HTTP::Tiny support. debug_ua() and
+ LWP::ConsoleLogger::Everywhere now log HTTP::Tiny requests and
+ responses alongside LWP::UserAgent and Mojo::UserAgent. Note the
+ HTTP::Tiny caveats documented in LWP::ConsoleLogger::Easy and
+ LWP::ConsoleLogger::Everywhere: redirect chains are collapsed to the
+ final response, mirror() bodies are not captured, and some
+ transport-layer headers are reconstructed on a best-effort basis
+ (GH#53)
+ - Lower the Term::Table prerequisite from 0.028 to 0.013. 0.013 is the
+ first release that supports the pad and allow_overflow constructor
+ options LWP::ConsoleLogger passes; the 0.028 pin was simply the
+ latest release when the dependency was added, not a real minimum
+ (GH#60) (Reported by: Petr Písař)
+
+-------------------------------------------------------------------
Old:
----
LWP-ConsoleLogger-1.000002.tar.gz
New:
----
LWP-ConsoleLogger-1.000003.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-LWP-ConsoleLogger.spec ++++++
--- /var/tmp/diff_new_pack.GWS0DU/_old 2026-11-06 19:49:46.860590416 +0100
+++ /var/tmp/diff_new_pack.GWS0DU/_new 2026-11-06 19:49:46.864590584 +0100
@@ -18,7 +18,7 @@
%define cpan_name LWP-ConsoleLogger
Name: perl-LWP-ConsoleLogger
-Version: 1.000002
+Version: 1.000003
Release: 0
License: Artistic-2.0
Summary: LWP tracing and debugging
@@ -43,6 +43,8 @@
BuildRequires: perl(HTTP::Headers)
BuildRequires: perl(HTTP::Request)
BuildRequires: perl(HTTP::Response)
+BuildRequires: perl(HTTP::Tiny)
+BuildRequires: perl(Hash::Util::FieldHash)
BuildRequires: perl(IPC::Run3)
BuildRequires: perl(JSON::MaybeXS) >= 1.3.5
BuildRequires: perl(LWP::UserAgent)
@@ -55,21 +57,25 @@
BuildRequires: perl(MooX::StrictConstructor)
BuildRequires: perl(Parse::MIME)
BuildRequires: perl(Path::Tiny)
+BuildRequires: perl(Plack)
BuildRequires: perl(Plack::Handler::HTTP::Server::Simple)
+BuildRequires: perl(Plack::Loader)
BuildRequires: perl(Plack::Test)
BuildRequires: perl(Plack::Test::Agent)
BuildRequires: perl(Ref::Util)
BuildRequires: perl(String::Trim)
BuildRequires: perl(Sub::Exporter)
BuildRequires: perl(Term::Size::Any)
-BuildRequires: perl(Term::Table) >= 0.028
+BuildRequires: perl(Term::Table) >= 0.013
BuildRequires: perl(Test::Fatal)
BuildRequires: perl(Test::LWP::UserAgent)
BuildRequires: perl(Test::Needs)
+BuildRequires: perl(Test::TCP)
BuildRequires: perl(Test::Warnings)
BuildRequires: perl(Try::Tiny)
BuildRequires: perl(Types::Common::Numeric)
BuildRequires: perl(Types::Standard)
+BuildRequires: perl(URI)
BuildRequires: perl(URI::QueryParam)
BuildRequires: perl(URI::file)
BuildRequires: perl(Unicode::GCString)
@@ -81,8 +87,10 @@
Requires: perl(HTML::Restrict)
Requires: perl(HTTP::Body)
Requires: perl(HTTP::CookieMonster)
+Requires: perl(HTTP::Headers)
Requires: perl(HTTP::Request)
Requires: perl(HTTP::Response)
+Requires: perl(Hash::Util::FieldHash)
Requires: perl(JSON::MaybeXS) >= 1.3.5
Requires: perl(List::AllUtils)
Requires: perl(Log::Dispatch) >= 2.560
@@ -95,10 +103,11 @@
Requires: perl(String::Trim)
Requires: perl(Sub::Exporter)
Requires: perl(Term::Size::Any)
-Requires: perl(Term::Table) >= 0.028
+Requires: perl(Term::Table) >= 0.013
Requires: perl(Try::Tiny)
Requires: perl(Types::Common::Numeric)
Requires: perl(Types::Standard)
+Requires: perl(URI)
Requires: perl(URI::QueryParam)
Recommends: perl(HTML::FormatText::Lynx) >= 23
Recommends: perl(Unicode::GCString)
++++++ LWP-ConsoleLogger-1.000002.tar.gz -> LWP-ConsoleLogger-1.000003.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LWP-ConsoleLogger-1.000002/Changes
new/LWP-ConsoleLogger-1.000003/Changes
--- old/LWP-ConsoleLogger-1.000002/Changes 2026-05-12 19:28:05.000000000
+0200
+++ new/LWP-ConsoleLogger-1.000003/Changes 2026-09-18 16:14:27.000000000
+0200
@@ -1,5 +1,20 @@
Revision history for LWP-ConsoleLogger
+1.000003 2026-09-18 14:14:21Z
+ - Add HTTP::Tiny support. debug_ua() and
+ LWP::ConsoleLogger::Everywhere now log HTTP::Tiny requests and
+ responses alongside LWP::UserAgent and Mojo::UserAgent. Note the
+ HTTP::Tiny caveats documented in LWP::ConsoleLogger::Easy and
+ LWP::ConsoleLogger::Everywhere: redirect chains are collapsed to the
+ final response, mirror() bodies are not captured, and some
+ transport-layer headers are reconstructed on a best-effort basis
+ (GH#53)
+ - Lower the Term::Table prerequisite from 0.028 to 0.013. 0.013 is the
+ first release that supports the pad and allow_overflow constructor
+ options LWP::ConsoleLogger passes; the 0.028 pin was simply the
+ latest release when the dependency was added, not a real minimum
+ (GH#60) (Reported by: Petr Písař)
+
1.000002 2026-05-12 17:28:01Z
- Replace Text::SimpleTable::AutoWidth (last released 2015) with
Term::Table to fix box-border misalignment when output contains
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LWP-ConsoleLogger-1.000002/MANIFEST
new/LWP-ConsoleLogger-1.000003/MANIFEST
--- old/LWP-ConsoleLogger-1.000002/MANIFEST 2026-05-12 19:28:05.000000000
+0200
+++ new/LWP-ConsoleLogger-1.000003/MANIFEST 2026-09-18 16:14:27.000000000
+0200
@@ -23,9 +23,6 @@
lib/LWP/ConsoleLogger.pm
lib/LWP/ConsoleLogger/Easy.pm
lib/LWP/ConsoleLogger/Everywhere.pm
-perlcriticrc
-perltidyrc
-precious.toml
t/00-report-prereqs.dd
t/00-report-prereqs.t
t/LWP/ConsoleLogger.t
@@ -37,6 +34,7 @@
t/decode-header-value.t
t/everywhere-logfile-child.pl
t/everywhere-logfile.t
+t/http-tiny.t
t/pretty.t
t/test-data/content-regex.html
t/test-data/file-upload.html
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LWP-ConsoleLogger-1.000002/META.json
new/LWP-ConsoleLogger-1.000003/META.json
--- old/LWP-ConsoleLogger-1.000002/META.json 2026-05-12 19:28:05.000000000
+0200
+++ new/LWP-ConsoleLogger-1.000003/META.json 2026-09-18 16:14:27.000000000
+0200
@@ -65,8 +65,10 @@
"HTML::Restrict" : "0",
"HTTP::Body" : "0",
"HTTP::CookieMonster" : "0",
+ "HTTP::Headers" : "0",
"HTTP::Request" : "0",
"HTTP::Response" : "0",
+ "Hash::Util::FieldHash" : "0",
"JSON::MaybeXS" : "1.003005",
"List::AllUtils" : "0",
"Log::Dispatch" : "2.56",
@@ -79,11 +81,13 @@
"String::Trim" : "0",
"Sub::Exporter" : "0",
"Term::Size::Any" : "0",
- "Term::Table" : "0.028",
+ "Term::Table" : "0.013",
"Try::Tiny" : "0",
"Types::Common::Numeric" : "0",
"Types::Standard" : "0",
+ "URI" : "0",
"URI::QueryParam" : "0",
+ "bytes" : "0",
"perl" : "5.016",
"strict" : "0",
"warnings" : "0"
@@ -104,18 +108,21 @@
"HTML::FormatText::WithLinks" : "0",
"HTTP::CookieJar::LWP" : "0",
"HTTP::Cookies" : "0",
- "HTTP::Headers" : "0",
+ "HTTP::Tiny" : "0",
"IPC::Run3" : "0",
"LWP::UserAgent" : "0",
"Log::Dispatch::Array" : "0",
"Path::Tiny" : "0",
+ "Plack" : "0",
"Plack::Handler::HTTP::Server::Simple" : "0",
+ "Plack::Loader" : "0",
"Plack::Test" : "0",
"Plack::Test::Agent" : "0",
"Test::Fatal" : "0",
"Test::LWP::UserAgent" : "0",
"Test::More" : "0",
"Test::Needs" : "0",
+ "Test::TCP" : "0",
"Test::Warnings" : "0",
"URI::file" : "0",
"Unicode::GCString" : "0",
@@ -137,7 +144,7 @@
"web" : "https://github.com/oalders/lwp-consolelogger"
}
},
- "version" : "1.000002",
+ "version" : "1.000003",
"x_Dist_Zilla" : {
"perl" : {
"version" : "5.042002"
@@ -679,7 +686,7 @@
"branch" : null,
"changelog" : "Changes",
"signed" : 0,
- "tag" : "v1.000002",
+ "tag" : "v1.000003",
"tag_format" : "v%V",
"tag_message" : "v%V"
},
@@ -780,6 +787,11 @@
"version" : "6.037"
},
{
+ "class" : "Dist::Zilla::Plugin::PruneFiles",
+ "name" : "PruneFiles",
+ "version" : "6.037"
+ },
+ {
"class" : "Dist::Zilla::Plugin::Prereqs",
"config" : {
"Dist::Zilla::Plugin::Prereqs" : {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LWP-ConsoleLogger-1.000002/META.yml
new/LWP-ConsoleLogger-1.000003/META.yml
--- old/LWP-ConsoleLogger-1.000002/META.yml 2026-05-12 19:28:05.000000000
+0200
+++ new/LWP-ConsoleLogger-1.000003/META.yml 2026-09-18 16:14:27.000000000
+0200
@@ -10,18 +10,21 @@
HTML::FormatText::WithLinks: '0'
HTTP::CookieJar::LWP: '0'
HTTP::Cookies: '0'
- HTTP::Headers: '0'
+ HTTP::Tiny: '0'
IPC::Run3: '0'
LWP::UserAgent: '0'
Log::Dispatch::Array: '0'
Path::Tiny: '0'
+ Plack: '0'
Plack::Handler::HTTP::Server::Simple: '0'
+ Plack::Loader: '0'
Plack::Test: '0'
Plack::Test::Agent: '0'
Test::Fatal: '0'
Test::LWP::UserAgent: '0'
Test::More: '0'
Test::Needs: '0'
+ Test::TCP: '0'
Test::Warnings: '0'
URI::file: '0'
Unicode::GCString: '0'
@@ -55,8 +58,10 @@
HTML::Restrict: '0'
HTTP::Body: '0'
HTTP::CookieMonster: '0'
+ HTTP::Headers: '0'
HTTP::Request: '0'
HTTP::Response: '0'
+ Hash::Util::FieldHash: '0'
JSON::MaybeXS: '1.003005'
List::AllUtils: '0'
Log::Dispatch: '2.56'
@@ -69,11 +74,13 @@
String::Trim: '0'
Sub::Exporter: '0'
Term::Size::Any: '0'
- Term::Table: '0.028'
+ Term::Table: '0.013'
Try::Tiny: '0'
Types::Common::Numeric: '0'
Types::Standard: '0'
+ URI: '0'
URI::QueryParam: '0'
+ bytes: '0'
perl: '5.016'
strict: '0'
warnings: '0'
@@ -81,7 +88,7 @@
bugtracker: https://github.com/oalders/lwp-consolelogger/issues
homepage: https://github.com/oalders/lwp-consolelogger
repository: https://github.com/oalders/lwp-consolelogger.git
-version: '1.000002'
+version: '1.000003'
x_Dist_Zilla:
perl:
version: '5.042002'
@@ -501,7 +508,7 @@
branch: ~
changelog: Changes
signed: 0
- tag: v1.000002
+ tag: v1.000003
tag_format: v%V
tag_message: v%V
Dist::Zilla::Role::Git::Repo:
@@ -575,6 +582,10 @@
name: RemovePrereqs
version: '6.037'
-
+ class: Dist::Zilla::Plugin::PruneFiles
+ name: PruneFiles
+ version: '6.037'
+ -
class: Dist::Zilla::Plugin::Prereqs
config:
Dist::Zilla::Plugin::Prereqs:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LWP-ConsoleLogger-1.000002/Makefile.PL
new/LWP-ConsoleLogger-1.000003/Makefile.PL
--- old/LWP-ConsoleLogger-1.000002/Makefile.PL 2026-05-12 19:28:05.000000000
+0200
+++ new/LWP-ConsoleLogger-1.000003/Makefile.PL 2026-09-18 16:14:27.000000000
+0200
@@ -24,8 +24,10 @@
"HTML::Restrict" => 0,
"HTTP::Body" => 0,
"HTTP::CookieMonster" => 0,
+ "HTTP::Headers" => 0,
"HTTP::Request" => 0,
"HTTP::Response" => 0,
+ "Hash::Util::FieldHash" => 0,
"JSON::MaybeXS" => "1.003005",
"List::AllUtils" => 0,
"Log::Dispatch" => "2.56",
@@ -38,11 +40,13 @@
"String::Trim" => 0,
"Sub::Exporter" => 0,
"Term::Size::Any" => 0,
- "Term::Table" => "0.028",
+ "Term::Table" => "0.013",
"Try::Tiny" => 0,
"Types::Common::Numeric" => 0,
"Types::Standard" => 0,
+ "URI" => 0,
"URI::QueryParam" => 0,
+ "bytes" => 0,
"strict" => 0,
"warnings" => 0
},
@@ -54,25 +58,28 @@
"HTML::FormatText::WithLinks" => 0,
"HTTP::CookieJar::LWP" => 0,
"HTTP::Cookies" => 0,
- "HTTP::Headers" => 0,
+ "HTTP::Tiny" => 0,
"IPC::Run3" => 0,
"LWP::UserAgent" => 0,
"Log::Dispatch::Array" => 0,
"Path::Tiny" => 0,
+ "Plack" => 0,
"Plack::Handler::HTTP::Server::Simple" => 0,
+ "Plack::Loader" => 0,
"Plack::Test" => 0,
"Plack::Test::Agent" => 0,
"Test::Fatal" => 0,
"Test::LWP::UserAgent" => 0,
"Test::More" => 0,
"Test::Needs" => 0,
+ "Test::TCP" => 0,
"Test::Warnings" => 0,
"URI::file" => 0,
"Unicode::GCString" => 0,
"WWW::Mechanize" => 0,
"version" => 0
},
- "VERSION" => "1.000002",
+ "VERSION" => "1.000003",
"test" => {
"TESTS" => "t/*.t t/LWP/*.t t/LWP/ConsoleLogger/*.t"
}
@@ -97,6 +104,8 @@
"HTTP::Headers" => 0,
"HTTP::Request" => 0,
"HTTP::Response" => 0,
+ "HTTP::Tiny" => 0,
+ "Hash::Util::FieldHash" => 0,
"IPC::Run3" => 0,
"JSON::MaybeXS" => "1.003005",
"LWP::UserAgent" => 0,
@@ -109,26 +118,31 @@
"MooX::StrictConstructor" => 0,
"Parse::MIME" => 0,
"Path::Tiny" => 0,
+ "Plack" => 0,
"Plack::Handler::HTTP::Server::Simple" => 0,
+ "Plack::Loader" => 0,
"Plack::Test" => 0,
"Plack::Test::Agent" => 0,
"Ref::Util" => 0,
"String::Trim" => 0,
"Sub::Exporter" => 0,
"Term::Size::Any" => 0,
- "Term::Table" => "0.028",
+ "Term::Table" => "0.013",
"Test::Fatal" => 0,
"Test::LWP::UserAgent" => 0,
"Test::More" => 0,
"Test::Needs" => 0,
+ "Test::TCP" => 0,
"Test::Warnings" => 0,
"Try::Tiny" => 0,
"Types::Common::Numeric" => 0,
"Types::Standard" => 0,
+ "URI" => 0,
"URI::QueryParam" => 0,
"URI::file" => 0,
"Unicode::GCString" => 0,
"WWW::Mechanize" => 0,
+ "bytes" => 0,
"strict" => 0,
"version" => 0,
"warnings" => 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LWP-ConsoleLogger-1.000002/README.md
new/LWP-ConsoleLogger-1.000003/README.md
--- old/LWP-ConsoleLogger-1.000002/README.md 2026-05-12 19:28:05.000000000
+0200
+++ new/LWP-ConsoleLogger-1.000003/README.md 2026-09-18 16:14:27.000000000
+0200
@@ -4,7 +4,7 @@
# VERSION
-version 1.000002
+version 1.000003
# SYNOPSIS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LWP-ConsoleLogger-1.000002/cpanfile
new/LWP-ConsoleLogger-1.000003/cpanfile
--- old/LWP-ConsoleLogger-1.000002/cpanfile 2026-05-12 19:28:05.000000000
+0200
+++ new/LWP-ConsoleLogger-1.000003/cpanfile 2026-09-18 16:14:27.000000000
+0200
@@ -8,8 +8,10 @@
requires "HTML::Restrict" => "0";
requires "HTTP::Body" => "0";
requires "HTTP::CookieMonster" => "0";
+requires "HTTP::Headers" => "0";
requires "HTTP::Request" => "0";
requires "HTTP::Response" => "0";
+requires "Hash::Util::FieldHash" => "0";
requires "JSON::MaybeXS" => "1.003005";
requires "List::AllUtils" => "0";
requires "Log::Dispatch" => "2.56";
@@ -22,11 +24,13 @@
requires "String::Trim" => "0";
requires "Sub::Exporter" => "0";
requires "Term::Size::Any" => "0";
-requires "Term::Table" => "0.028";
+requires "Term::Table" => "0.013";
requires "Try::Tiny" => "0";
requires "Types::Common::Numeric" => "0";
requires "Types::Standard" => "0";
+requires "URI" => "0";
requires "URI::QueryParam" => "0";
+requires "bytes" => "0";
requires "perl" => "5.016";
requires "strict" => "0";
requires "warnings" => "0";
@@ -42,18 +46,21 @@
requires "HTML::FormatText::WithLinks" => "0";
requires "HTTP::CookieJar::LWP" => "0";
requires "HTTP::Cookies" => "0";
- requires "HTTP::Headers" => "0";
+ requires "HTTP::Tiny" => "0";
requires "IPC::Run3" => "0";
requires "LWP::UserAgent" => "0";
requires "Log::Dispatch::Array" => "0";
requires "Path::Tiny" => "0";
+ requires "Plack" => "0";
requires "Plack::Handler::HTTP::Server::Simple" => "0";
+ requires "Plack::Loader" => "0";
requires "Plack::Test" => "0";
requires "Plack::Test::Agent" => "0";
requires "Test::Fatal" => "0";
requires "Test::LWP::UserAgent" => "0";
requires "Test::More" => "0";
requires "Test::Needs" => "0";
+ requires "Test::TCP" => "0";
requires "Test::Warnings" => "0";
requires "URI::file" => "0";
requires "Unicode::GCString" => "0";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LWP-ConsoleLogger-1.000002/dist.ini
new/LWP-ConsoleLogger-1.000003/dist.ini
--- old/LWP-ConsoleLogger-1.000002/dist.ini 2026-05-12 19:28:05.000000000
+0200
+++ new/LWP-ConsoleLogger-1.000003/dist.ini 2026-09-18 16:14:27.000000000
+0200
@@ -17,6 +17,12 @@
remove = Parallel::ForkManager
remove = Test::Vars
+[PruneFiles]
+filename = precious.toml
+filename = .perltidyrc
+filename = .perlcriticrc
+filename = scripts/pre-commit
+
[Prereqs / DevelopRequires]
App::perlvars = 0
@@ -25,7 +31,7 @@
Encode = 0
JSON::MaybeXS = 1.003005
Log::Dispatch = 2.56
-Term::Table = 0.028
+Term::Table = 0.013 ; 0.013 first shipped the pad + allow_overflow options
we pass
perl = 5.016 ; Mojo dep in tests
[Prereqs / RuntimeRecommends]
@@ -34,7 +40,10 @@
XML::Simple = 0
[Prereqs / TestRequires]
+HTTP::Tiny = 0
IPC::Run3 = 0
+Plack = 0
+Test::TCP = 0
[Prereqs / TestRecommends]
Mojolicious = 7.13
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/LWP-ConsoleLogger-1.000002/lib/LWP/ConsoleLogger/Easy.pm
new/LWP-ConsoleLogger-1.000003/lib/LWP/ConsoleLogger/Easy.pm
--- old/LWP-ConsoleLogger-1.000002/lib/LWP/ConsoleLogger/Easy.pm
2026-05-12 19:28:05.000000000 +0200
+++ new/LWP-ConsoleLogger-1.000003/lib/LWP/ConsoleLogger/Easy.pm
2026-09-18 16:14:27.000000000 +0200
@@ -3,14 +3,22 @@
use strict;
use warnings;
-our $VERSION = '1.000002';
+our $VERSION = '1.000003';
+use Class::Method::Modifiers ();
+use Hash::Util::FieldHash qw( fieldhash );
+use HTTP::Headers ();
use HTTP::Request ();
use HTTP::Response ();
use LWP::ConsoleLogger ();
use Module::Load::Conditional qw( can_load );
+use Ref::Util qw( is_plain_arrayref is_ref );
use Sub::Exporter -setup => { exports => ['debug_ua'] };
use String::Trim qw( trim );
+use URI ();
+
+fieldhash my %http_tiny_loggers;
+my $http_tiny_wrapped;
my %VERBOSITY = (
dump_content => 8,
@@ -93,6 +101,10 @@
);
return;
}
+ if ( $ua->isa('HTTP::Tiny') ) {
+ _instrument_http_tiny( $ua, $console_logger );
+ return;
+ }
$ua->add_handler(
'response_done',
@@ -104,6 +116,188 @@
);
}
+sub _instrument_http_tiny {
+ my $ua = shift;
+ my $console_logger = shift;
+
+ push @{ $http_tiny_loggers{$ua} ||= [] }, $console_logger;
+
+ return if $http_tiny_wrapped;
+ $http_tiny_wrapped = 1;
+
+ Class::Method::Modifiers::install_modifier(
+ 'HTTP::Tiny', 'around', 'request',
+ sub {
+ my $orig = shift;
+ my $self = shift;
+ my ( $method, $url, $args ) = @_;
+
+ my $console_loggers
+ = is_ref($self) ? $http_tiny_loggers{$self} : undef;
+ return $self->$orig(@_) unless $console_loggers;
+
+ # Logging must never break the caller: any die while translating
+ # the request or running the request_callback is caught here so
+ # the real HTTP call still happens below. Seed $request with a
+ # minimal object first so that, even if the richer translation
+ # below dies, the response can still be logged against a valid
+ # request rather than being discarded too.
+ my $request = HTTP::Request->new( $method, $url );
+ eval {
+ $request = _http_tiny_request_object(
+ $self, $method, $url,
+ $args
+ );
+ $_->request_callback( $request, $self )
+ for @{$console_loggers};
+ 1;
+ } or do {
+ warn
+ "LWP::ConsoleLogger: HTTP::Tiny request logging failed:
$@";
+ };
+
+ # Always perform the real request and always return its response,
+ # even if logging blew up above.
+ my $response = $self->$orig(@_);
+
+ # Likewise, never let response translation or the response_callback
+ # discard an already-completed HTTP response. $request is always a
+ # valid object here (seeded above), even if the richer translation
+ # died, so the response is still logged against a real request.
+ eval {
+ my $res = _http_tiny_response_object( $response, $request );
+ $_->response_callback( $res, $self ) for @{$console_loggers};
+ 1;
+ } or do {
+ warn
+ "LWP::ConsoleLogger: HTTP::Tiny response logging failed:
$@";
+ };
+
+ return $response;
+ }
+ );
+}
+
+sub _copy_headers {
+ my $headers = shift;
+ my $hashref = shift;
+
+ return unless $hashref;
+
+ foreach my $name ( keys %{$hashref} ) {
+ my $val = $hashref->{$name};
+ $headers->push_header(
+ $name,
+ is_plain_arrayref($val) ? @{$val} : $val
+ );
+ }
+ return;
+}
+
+sub _http_tiny_request_object {
+ my $self = shift;
+ my $method = shift;
+ my $url = shift;
+ my $args = shift;
+ $args ||= {};
+
+ my $headers = HTTP::Headers->new;
+
+ # HTTP::Tiny merges default_headers first, then per-request headers, with
+ # the per-request value winning (last-wins) rather than being appended.
+ # Merge both sources into one hash so a duplicated name produces a single
+ # overriding row, then copy once. Header names are compared
+ # case-insensitively (as HTTP::Tiny and HTTP::Headers both treat them) so
+ # that e.g. a default "Content-Type" and a per-request "content-type"
+ # collapse to one value instead of two appended rows. Arrayref values (a
+ # single header carrying multiple values) are preserved.
+ my %merged; # lc name => [ display name => value ]
+ foreach my $source ( $self->default_headers, $args->{headers} ) {
+ next unless $source;
+ $merged{ lc $_ } = [ $_ => $source->{$_} ] for keys %{$source};
+ }
+ my %clean = map { @{$_} } values %merged;
+ _copy_headers( $headers, \%clean );
+
+ # HTTP::Tiny synthesizes a Host header at send time.
+ unless ( defined $headers->header('Host') ) {
+ my $uri = URI->new($url);
+ my $host = eval { $uri->host };
+ $host = "[$host]" if defined $host && $host =~ /:/;
+ if ( defined $host ) {
+ my %default_port = ( http => 80, https => 443 );
+ my $scheme = lc( $uri->scheme // q{} );
+ my $port = eval { $uri->port };
+ if ( defined $port
+ && defined $default_port{$scheme}
+ && $port != $default_port{$scheme} ) {
+ $host .= ":$port";
+ }
+ $headers->header( Host => $host );
+ }
+ }
+
+ # HTTP::Tiny synthesizes a User-Agent header from its agent attribute.
+ if ( defined $self->agent
+ && !defined $headers->header('User-Agent') ) {
+ $headers->header( 'User-Agent' => $self->agent );
+ }
+
+ my $content = $args->{content};
+
+ # A coderef content is a streaming body we cannot capture.
+ $content = undef if is_ref($content);
+
+ my $request = HTTP::Request->new( $method, $url, $headers, $content );
+
+ if ( defined $content ) {
+
+ # HTTP::Tiny computes Content-Length internally, so it is absent from
+ # the request options. Supply it so the body params get logged. Use
+ # a byte length (not a character length) to match what HTTP::Tiny
+ # actually sends on the wire.
+ if ( !defined $request->header('Content-Length') ) {
+ my $length = do { use bytes; length $content };
+ $request->header( 'Content-Length' => $length );
+ }
+
+ # HTTP::Tiny defaults raw content to application/octet-stream when no
+ # Content-Type is supplied; _log_params/_log_text rely on it.
+ if ( !defined $request->header('Content-Type') ) {
+ $request->header( 'Content-Type' => 'application/octet-stream' );
+ }
+ }
+
+ elsif ( ( $method eq 'POST' || $method eq 'PUT' )
+ && !is_ref( $args->{content} )
+ && !defined $request->header('Content-Length') ) {
+
+ # HTTP::Tiny sends an explicit zero length for empty POST and PUT
+ # requests so that servers do not wait for a body. A coderef body is
+ # excluded: HTTP::Tiny streams it with chunked transfer-encoding
+ # rather than a zero Content-Length.
+ $request->header( 'Content-Length' => 0 );
+ }
+ return $request;
+}
+
+sub _http_tiny_response_object {
+ my $response = shift;
+ my $request = shift;
+
+ my $headers = HTTP::Headers->new;
+ _copy_headers( $headers, $response->{headers} );
+
+ my $res = HTTP::Response->new(
+ $response->{status}, $response->{reason},
+ $headers, $response->{content},
+ );
+ $res->protocol( $response->{protocol} ) if $response->{protocol};
+ $res->request($request);
+
+ return $res;
+}
+
1;
=pod
@@ -116,7 +310,7 @@
=head1 VERSION
-version 1.000002
+version 1.000003
=head1 SYNOPSIS
@@ -169,7 +363,16 @@
$ua->get(...);
C<$ua> may be one of several user-agents, including C<LWP::UserAgent>,
-C<Mojo::UserAgent>, and C<WWW::Mechanize>.
+C<Mojo::UserAgent>, C<HTTP::Tiny>, and C<WWW::Mechanize>.
+
+When C<$ua> is an L<HTTP::Tiny> object, be aware of a few limitations that
+the L<LWP::UserAgent> and L<Mojo::UserAgent> paths do not share: redirect
+chains are collapsed so only the final response is logged, C<< $ua->mirror >>
+streams the body to a file so the body and text tables are empty, and some
+transport-layer headers (for example C<Connection>, or an C<Authorization>
+header synthesized from C<userinfo> in the URL) are reconstructed on a
+best-effort basis and may not match what goes out on the wire. See
+L<LWP::ConsoleLogger::Everywhere/CAVEATS> for the full list.
You can provide a verbosity level of 0 or more. (Currently 0 - 8 supported.)
This will turn up the verbosity on your output gradually. A verbosity of 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/LWP-ConsoleLogger-1.000002/lib/LWP/ConsoleLogger/Everywhere.pm
new/LWP-ConsoleLogger-1.000003/lib/LWP/ConsoleLogger/Everywhere.pm
--- old/LWP-ConsoleLogger-1.000002/lib/LWP/ConsoleLogger/Everywhere.pm
2026-05-12 19:28:05.000000000 +0200
+++ new/LWP-ConsoleLogger-1.000003/lib/LWP/ConsoleLogger/Everywhere.pm
2026-09-18 16:14:27.000000000 +0200
@@ -2,7 +2,7 @@
use strict;
use warnings;
-our $VERSION = '1.000002';
+our $VERSION = '1.000003';
use Class::Method::Modifiers ();
use LWP::ConsoleLogger::Easy qw( debug_ua );
@@ -58,6 +58,14 @@
);
};
+try {
+ require_module('HTTP::Tiny');
+ Class::Method::Modifiers::install_modifier(
+ 'HTTP::Tiny', 'around',
+ 'new' => $code_injection
+ );
+};
+
sub loggers {
return $loggers;
}
@@ -85,7 +93,7 @@
=head1 VERSION
-version 1.000002
+version 1.000003
=head1 SYNOPSIS
@@ -114,7 +122,8 @@
=head1 DESCRIPTION
-This module turns on L<LWP::ConsoleLogger::Easy> debugging for every
L<LWP::UserAgent> or L<Mojo::UserAgent>
+This module turns on L<LWP::ConsoleLogger::Easy> debugging for every
L<LWP::UserAgent>,
+L<Mojo::UserAgent>, or L<HTTP::Tiny>
based user agent anywhere in your code. It doesn't matter what package or
class it is in,
or if you have access to the object itself. All you need to do is C<use> this
module
anywhere in your code and it will work.
@@ -202,7 +211,40 @@
L<LWP::ConsoleLogger::Everywhere> will keep references to all user agents that
were
ever created during for the lifetime of your application. If you have a lot of
lexical
user agents that you recycle all the time they will not actually go away and
might
-consume memory.
+consume memory. This is especially easy to hit with L<HTTP::Tiny>, where the
common
+C<< HTTP::Tiny->new->get(...) >> one-shot idiom creates a fresh logger on
every call.
+
+L<HTTP::Tiny> traffic is only captured when the user agent is created via
+C<< HTTP::Tiny->new >>. Class-method calls such as C<< HTTP::Tiny->get(...) >>
+bypass the constructor and are not logged. Also, because C<<
HTTP::Tiny->mirror >>
+streams the response body straight to a file, the body and text tables will be
+empty for C<mirror> requests.
+
+The L<HTTP::Tiny> path has a few further limitations that the L<LWP::UserAgent>
+and L<Mojo::UserAgent> paths do not share:
+
+=over 4
+
+=item *
+
+Redirect chains are collapsed. L<HTTP::Tiny> follows redirects internally and
+only the final response is visible to the logger, so intermediate hops are not
+logged. The LWP and L<Mojo::UserAgent> paths log each hop separately.
+
+=item *
+
+Some headers that L<HTTP::Tiny> adds at the transport layer are reconstructed
+on a best-effort basis and may not exactly match what goes out on the wire. For
+example the C<Connection> header and an C<Authorization> header synthesized
from
+C<userinfo> in the request URL are not reflected in the logged request.
+
+=item *
+
+Cookie values are B<not> redacted by the C<LWPCL_REDACT_*> environment
+variables. This is existing behaviour shared with the LWP and
L<Mojo::UserAgent> paths and is
+noted here so the logged output is not mistaken for a redacted view.
+
+=back
=head1 SEE ALSO
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LWP-ConsoleLogger-1.000002/lib/LWP/ConsoleLogger.pm
new/LWP-ConsoleLogger-1.000003/lib/LWP/ConsoleLogger.pm
--- old/LWP-ConsoleLogger-1.000002/lib/LWP/ConsoleLogger.pm 2026-05-12
19:28:05.000000000 +0200
+++ new/LWP-ConsoleLogger-1.000003/lib/LWP/ConsoleLogger.pm 2026-09-18
16:14:27.000000000 +0200
@@ -5,7 +5,7 @@
use 5.006;
-our $VERSION = '1.000002';
+our $VERSION = '1.000003';
use Data::Printer { end_separator => 1, hash_separator => ' => ' };
use DateTime ();
@@ -18,9 +18,9 @@
use Log::Dispatch ();
use Module::Load::Conditional qw( can_load );
use Parse::MIME qw( parse_mime_type );
-use Ref::Util qw( is_blessed_ref );
+use Ref::Util qw( is_arrayref is_blessed_ref is_ref );
use Term::Size::Any ();
-use Term::Table 0.028 ();
+use Term::Table 0.013 ();
use Try::Tiny qw( catch try );
use Types::Common::Numeric qw( PositiveInt );
use Types::Standard qw( ArrayRef Bool CodeRef InstanceOf );
@@ -285,8 +285,8 @@
my @values
= ( any { $name eq $_ } @{ $self->params_to_redact } )
? '[REDACTED]'
- : ref $params{$name} ? @{ $params{$name} }
- : $params{$name};
+ : is_arrayref( $params{$name} ) ? @{ $params{$name} }
+ : $params{$name};
push @rows, [ $name, $_ ] for sort @values;
}
@@ -319,7 +319,7 @@
$val = DateTime->from_epoch( epoch => $val )
if $method eq 'expires';
$val = $self->_decode_header_value($val)
- unless ref $val; # leave DateTime objects alone
+ unless is_ref($val); # leave DateTime objects alone
push @rows, [ $method, $val ];
}
}
@@ -341,7 +341,7 @@
$val = DateTime->from_epoch( epoch => $val );
}
$val = $self->_decode_header_value($val)
- if defined $val && !ref $val;
+ if defined $val && !is_ref($val);
push @rows, [ $key, $val ];
}
@@ -566,7 +566,7 @@
=head1 VERSION
-version 1.000002
+version 1.000003
=head1 SYNOPSIS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LWP-ConsoleLogger-1.000002/perlcriticrc
new/LWP-ConsoleLogger-1.000003/perlcriticrc
--- old/LWP-ConsoleLogger-1.000002/perlcriticrc 2026-05-12 19:28:05.000000000
+0200
+++ new/LWP-ConsoleLogger-1.000003/perlcriticrc 1970-01-01 01:00:00.000000000
+0100
@@ -1,86 +0,0 @@
-severity = 3
-verbose = 11
-
-theme = core + pbp + bugs + maintenance + cosmetic + complexity + security +
tests + moose
-
-exclude = Subroutines::ProhibitCallsToUndeclaredSubs
-
-[BuiltinFunctions::ProhibitStringySplit]
-severity = 3
-
-[CodeLayout::RequireTrailingCommas]
-severity = 3
-
-[ControlStructures::ProhibitCStyleForLoops]
-severity = 3
-
-[InputOutput::RequireCheckedSyscalls]
-functions = :builtins
-exclude_functions = sleep
-severity = 3
-
-[Moose::RequireCleanNamespace]
-modules = Moose Moose::Role MooseX::Role::Parameterized
Moose::Util::TypeConstraints
-cleaners = namespace::autoclean
-
-[NamingConventions::Capitalization]
-package_exemptions = [A-Z]\w+|minFraud
-file_lexical_variables = [A-Z]\w+|[^A-Z]+
-global_variables = :starts_with_upper
-scoped_lexical_variables = [A-Z]\w+|[^A-Z]+
-severity = 3
-
-# Given our code base, leaving this at 5 would be a huge pain
-[Subroutines::ProhibitManyArgs]
-max_arguments = 10
-
-[RegularExpressions::ProhibitComplexRegexes]
-max_characters = 200
-
-[RegularExpressions::ProhibitUnusualDelimiters]
-severity = 3
-
-[Subroutines::ProhibitUnusedPrivateSubroutines]
-private_name_regex = _(?!build)\w+
-skip_when_using = Moo::Role Moose::Role MooseX::Role::Parameterized Role::Tiny
Test::Class::Moose::Role
-
-[TestingAndDebugging::ProhibitNoWarnings]
-allow = redefine
-
-[ValuesAndExpressions::ProhibitEmptyQuotes]
-severity = 3
-
-[ValuesAndExpressions::ProhibitInterpolationOfLiterals]
-severity = 3
-
-[ValuesAndExpressions::RequireUpperCaseHeredocTerminator]
-severity = 3
-
-[Variables::ProhibitPackageVars]
-add_packages = Test::Builder
-
-[TestingAndDebugging::RequireUseStrict]
-
-[TestingAndDebugging::RequireUseWarnings]
-
-[-ControlStructures::ProhibitCascadingIfElse]
-
-[-ErrorHandling::RequireCarping]
-[-InputOutput::RequireBriefOpen]
-
-[-ValuesAndExpressions::ProhibitConstantPragma]
-
-# No need for /xsm everywhere
-[-RegularExpressions::RequireDotMatchAnything]
-[-RegularExpressions::RequireExtendedFormatting]
-[-RegularExpressions::RequireLineBoundaryMatching]
-
-[-Subroutines::ProhibitExplicitReturnUndef]
-
-#
http://stackoverflow.com/questions/2275317/why-does-perlcritic-dislike-using-shift-to-populate-subroutine-variables
-[-Subroutines::RequireArgUnpacking]
-
-[-Subroutines::RequireFinalReturn]
-
-# "use v5.14" is more readable than "use 5.014"
-[-ValuesAndExpressions::ProhibitVersionStrings]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LWP-ConsoleLogger-1.000002/perltidyrc
new/LWP-ConsoleLogger-1.000003/perltidyrc
--- old/LWP-ConsoleLogger-1.000002/perltidyrc 2026-05-12 19:28:05.000000000
+0200
+++ new/LWP-ConsoleLogger-1.000003/perltidyrc 1970-01-01 01:00:00.000000000
+0100
@@ -1,12 +0,0 @@
---blank-lines-before-packages=0
---iterations=2
---no-outdent-long-comments
--b
--bar
--boc
--ci=4
--i=4
--l=78
--nolq
--se
--wbb="% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /=
|= >>= ||= .= %= ^= x="
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LWP-ConsoleLogger-1.000002/precious.toml
new/LWP-ConsoleLogger-1.000003/precious.toml
--- old/LWP-ConsoleLogger-1.000002/precious.toml 2026-05-12
19:28:05.000000000 +0200
+++ new/LWP-ConsoleLogger-1.000003/precious.toml 1970-01-01
01:00:00.000000000 +0100
@@ -1,74 +0,0 @@
-exclude = [
- ".build/**",
- "LWP-ConsoleLogger-*/**",
- "blib/**",
- "local/**",
-]
-
-[commands.perltidy]
-type = "both"
-include = ["**/*.{pl,pm,t,psgi}"]
-exclude = [
- "t/00-*",
- "t/author-*",
- "t/release-*",
- "t/zzz-*",
- "xt/**",
-]
-cmd = ["perltidy", "--profile=$PRECIOUS_ROOT/perltidyrc"]
-lint-flags = ["--assert-tidy", "--no-standard-output",
"--outfile=/dev/null"]
-tidy-flags = ["--backup-and-modify-in-place",
"--backup-file-extension=/"]
-ok-exit-codes = 0
-lint-failure-exit-codes = 2
-ignore-stderr = "Begin Error Output Stream"
-
-[commands.perltidy-xt-pithub]
-type = "both"
-include = "xt/pithub.t"
-cmd = ["perltidy", "--profile=$PRECIOUS_ROOT/perltidyrc"]
-lint-flags = ["--assert-tidy", "--no-standard-output",
"--outfile=/dev/null"]
-tidy-flags = ["--backup-and-modify-in-place",
"--backup-file-extension=/"]
-ok-exit-codes = 0
-lint-failure-exit-codes = 2
-ignore-stderr = "Begin Error Output Stream"
-
-[commands.perlcritic]
-type = "lint"
-include = "xt/pithub.t"
-cmd = ["perlcritic",
"--profile=$PRECIOUS_ROOT/perlcriticrc"]
-ok-exit-codes = 0
-lint-failure-exit-codes = 2
-
-[commands.perlvars]
-type = "lint"
-include = ["**/*.{pl,pm,t,psgi}"]
-exclude = [
- "t/00-*",
- "t/author-*",
- "t/release-*",
- "t/zzz-*",
-]
-cmd = ["perlvars"]
-ok-exit-codes = 0
-lint-failure-exit-codes = [1, 255]
-ignore-stderr = "contains no package"
-
-[commands.omegasort-gitignore]
-type = "both"
-include = ".gitignore"
-cmd = ["omegasort", "--sort", "path", "--unique"]
-lint-flags = "--check"
-tidy-flags = "--in-place"
-ok-exit-codes = 0
-lint-failure-exit-codes = 1
-ignore-stderr = ["The .+ file is not sorted", "The .+ file is not
unique"]
-
-[commands.omegasort-stopwords]
-type = "both"
-include = ".stopwords"
-cmd = ["omegasort", "--sort", "text", "--unique",
"--case-insensitive"]
-lint-flags = "--check"
-tidy-flags = "--in-place"
-ok-exit-codes = 0
-lint-failure-exit-codes = 1
-ignore-stderr = ["The .+ file is not sorted", "The .+ file is not
unique"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LWP-ConsoleLogger-1.000002/t/00-report-prereqs.dd
new/LWP-ConsoleLogger-1.000003/t/00-report-prereqs.dd
--- old/LWP-ConsoleLogger-1.000002/t/00-report-prereqs.dd 2026-05-12
19:28:05.000000000 +0200
+++ new/LWP-ConsoleLogger-1.000003/t/00-report-prereqs.dd 2026-09-18
16:14:27.000000000 +0200
@@ -43,8 +43,10 @@
'HTML::Restrict' => '0',
'HTTP::Body' => '0',
'HTTP::CookieMonster' => '0',
+ 'HTTP::Headers' => '0',
'HTTP::Request' => '0',
'HTTP::Response' => '0',
+ 'Hash::Util::FieldHash' => '0',
'JSON::MaybeXS' => '1.003005',
'List::AllUtils' => '0',
'Log::Dispatch' => '2.56',
@@ -57,11 +59,13 @@
'String::Trim' => '0',
'Sub::Exporter' => '0',
'Term::Size::Any' => '0',
- 'Term::Table' => '0.028',
+ 'Term::Table' => '0.013',
'Try::Tiny' => '0',
'Types::Common::Numeric' => '0',
'Types::Standard' => '0',
+ 'URI' => '0',
'URI::QueryParam' => '0',
+ 'bytes' => '0',
'perl' => '5.016',
'strict' => '0',
'warnings' => '0'
@@ -82,18 +86,21 @@
'HTML::FormatText::WithLinks' => '0',
'HTTP::CookieJar::LWP' => '0',
'HTTP::Cookies' => '0',
- 'HTTP::Headers' => '0',
+ 'HTTP::Tiny' => '0',
'IPC::Run3' => '0',
'LWP::UserAgent' => '0',
'Log::Dispatch::Array' => '0',
'Path::Tiny' => '0',
+ 'Plack' => '0',
'Plack::Handler::HTTP::Server::Simple' =>
'0',
+ 'Plack::Loader' => '0',
'Plack::Test' => '0',
'Plack::Test::Agent' => '0',
'Test::Fatal' => '0',
'Test::LWP::UserAgent' => '0',
'Test::More' => '0',
'Test::Needs' => '0',
+ 'Test::TCP' => '0',
'Test::Warnings' => '0',
'URI::file' => '0',
'Unicode::GCString' => '0',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/LWP-ConsoleLogger-1.000002/t/LWP/ConsoleLogger/Everywhere.t
new/LWP-ConsoleLogger-1.000003/t/LWP/ConsoleLogger/Everywhere.t
--- old/LWP-ConsoleLogger-1.000002/t/LWP/ConsoleLogger/Everywhere.t
2026-05-12 19:28:05.000000000 +0200
+++ new/LWP-ConsoleLogger-1.000003/t/LWP/ConsoleLogger/Everywhere.t
2026-09-18 16:14:27.000000000 +0200
@@ -3,12 +3,15 @@
use version;
use Capture::Tiny qw( capture_stderr );
+use HTTP::Tiny ();
use LWP::UserAgent ();
use Module::Runtime qw( require_module );
use Path::Tiny qw( path );
+use Plack::Loader ();
+use Test::TCP;
use Test::Warnings;
use Test::Fatal qw( exception );
-use Test::More import => [qw( diag done_testing is ok skip )];
+use Test::More import => [qw( diag done_testing is like ok skip )];
use Try::Tiny qw( catch try );
use WWW::Mechanize ();
@@ -104,12 +107,39 @@
ok $stderr, '... and there was a dump';
}
+# HTTP::Tiny support: creating an instance should register a new logger.
+my $before_http_tiny = scalar @{ LWP::ConsoleLogger::Everywhere->loggers };
+my $http_tiny = HTTP::Tiny->new;
+is(
+ scalar @{ LWP::ConsoleLogger::Everywhere->loggers },
+ $before_http_tiny + 1,
+ 'HTTP::Tiny->new registers a new logger'
+);
+
+test_tcp(
+ client => sub {
+ my $port = shift;
+ my $url = "http://127.0.0.1:$port/";
+ my $stderr = capture_stderr sub {
+ $http_tiny->get($url);
+ };
+ ok $stderr, 'HTTP::Tiny request produced a dump';
+ like $stderr, qr{200}, '... and it mentions the status';
+ },
+ server => sub {
+ my $port = shift;
+ Plack::Loader->auto( port => $port, host => '127.0.0.1' )
+ ->run(
+ sub { [ 200, [ 'Content-Type' => 'text/plain' ], ['ok'] ] } );
+ },
+);
+
is(
(
grep { $_->isa('LWP::ConsoleLogger') }
@{ LWP::ConsoleLogger::Everywhere->loggers }
),
- 4 + defined($mojo) + defined($mojo_based) + defined($Foo::Bar::mua)
+ 5 + defined($mojo) + defined($mojo_based) + defined($Foo::Bar::mua)
+ defined($Foo::Bar::mua_based),
'all loggers are stored'
);
@@ -127,7 +157,7 @@
grep { $_->dump_content == 0 }
@{ LWP::ConsoleLogger::Everywhere->loggers }
),
- 4 + defined($mojo) + defined($mojo_based) + defined($Foo::Bar::mua)
+ 5 + defined($mojo) + defined($mojo_based) + defined($Foo::Bar::mua)
+ defined($Foo::Bar::mua_based),
'... and all loggers have been changed'
);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LWP-ConsoleLogger-1.000002/t/http-tiny.t
new/LWP-ConsoleLogger-1.000003/t/http-tiny.t
--- old/LWP-ConsoleLogger-1.000002/t/http-tiny.t 1970-01-01
01:00:00.000000000 +0100
+++ new/LWP-ConsoleLogger-1.000003/t/http-tiny.t 2026-09-18
16:14:27.000000000 +0200
@@ -0,0 +1,250 @@
+use strict;
+use warnings;
+
+use HTTP::Tiny ();
+use LWP::ConsoleLogger::Easy qw( debug_ua );
+use Log::Dispatch ();
+use Log::Dispatch::Array ();
+use Plack::Loader ();
+use Ref::Util qw( is_hashref );
+use Test::More import => [qw( done_testing is like ok unlike )];
+use Test::TCP;
+
+# Unit assertions (no network).
+{
+ my $logger = debug_ua( HTTP::Tiny->new );
+ ok(
+ $logger->isa('LWP::ConsoleLogger'),
+ 'debug_ua returns a configured LWP::ConsoleLogger'
+ );
+ ok( $logger->dump_content, 'dump_content defaults on' );
+
+ my $silent = debug_ua( HTTP::Tiny->new, 0 );
+ ok( !$silent->dump_content, 'verbosity 0 turns dump_content off' );
+ ok( !$silent->dump_headers, 'verbosity 0 turns dump_headers off' );
+}
+
+# Request-object translation edge cases (no network). These exercise the
+# header synthesis that mirrors what HTTP::Tiny puts on the wire.
+{
+ my $ua = HTTP::Tiny->new;
+
+ # An IPv6 literal with a non-default port must be bracketed in the Host
+ # header, matching HTTP::Tiny's host_port (e.g. [::1]:8080). URI->host
+ # returns the address without brackets.
+ my $ipv6 = LWP::ConsoleLogger::Easy::_http_tiny_request_object(
+ $ua, 'GET',
+ 'http://[::1]:8080/x', {}
+ );
+ is(
+ $ipv6->header('Host'), '[::1]:8080',
+ 'IPv6 host with custom port is bracketed in the Host header'
+ );
+
+ # An empty-body POST/PUT gets an explicit Content-Length: 0, as HTTP::Tiny
+ # sends so servers do not wait for a body.
+ for my $method (qw( POST PUT )) {
+ my $req = LWP::ConsoleLogger::Easy::_http_tiny_request_object(
+ $ua,
+ $method, 'http://example.com/', {}
+ );
+ is(
+ $req->header('Content-Length'), 0,
+ "empty $method logs Content-Length: 0"
+ );
+ }
+
+ # A coderef (streaming) body is not an empty body: HTTP::Tiny uses chunked
+ # transfer-encoding, so no zero Content-Length should be synthesized.
+ my $stream = LWP::ConsoleLogger::Easy::_http_tiny_request_object(
+ $ua, 'POST', 'http://example.com/',
+ { content => sub { q{} } }
+ );
+ ok(
+ !defined $stream->header('Content-Length'),
+ 'coderef POST body does not get a zero Content-Length'
+ );
+
+ # A GET with no body is untouched.
+ my $get = LWP::ConsoleLogger::Easy::_http_tiny_request_object(
+ $ua, 'GET',
+ 'http://example.com/', {}
+ );
+ ok(
+ !defined $get->header('Content-Length'),
+ 'empty GET has no Content-Length'
+ );
+}
+
+# Multiple loggers instrumenting one HTTP::Tiny instance must both fire; an
+# earlier debug_ua() call must not be overwritten by a later one. Uses the
+# synthetic 599 file:// path so no network is required.
+{
+ my $ua = HTTP::Tiny->new;
+
+ my @outputs;
+ for my $i ( 0, 1 ) {
+ my $logger = debug_ua($ua);
+ $logger->text_pre_filter( sub { shift } );
+ my $output = [];
+ my $ld = Log::Dispatch->new;
+ $ld->add(
+ Log::Dispatch::Array->new(
+ name => "multi$i",
+ min_level => 'debug',
+ array => $output,
+ )
+ );
+ $logger->logger($ld);
+ push @outputs, $output;
+ }
+
+ $ua->get('file:///no/such');
+
+ for my $i ( 0, 1 ) {
+ my $log = join "\n", map { $_->{message} } @{ $outputs[$i] };
+ like(
+ $log, qr{599},
+ "logger $i attached to the same UA still fires"
+ );
+ }
+}
+
+# Live capture through a real HTTP server (HTTP::Tiny does not support
+# file:// URLs).
+test_tcp(
+ client => sub {
+ my $port = shift;
+ my $base = "http://127.0.0.1:$port/";
+
+ my $ua = HTTP::Tiny->new;
+ my $logger = debug_ua($ua);
+
+ my $output = [];
+ my $ld = Log::Dispatch->new;
+ $ld->add(
+ Log::Dispatch::Array->new(
+ name => 'test',
+ min_level => 'debug',
+ array => $output,
+ )
+ );
+ $logger->logger($ld);
+
+ # Neutralize any Lynx-based text filter so body assertions are
+ # environment-independent.
+ $logger->text_pre_filter( sub { shift } );
+
+ # GET
+ my $get = $ua->get($base);
+ is( $get->{status}, 200, 'GET returns 200' );
+
+ my $get_log = join "\n", map { $_->{message} } @{$output};
+ like( $get_log, qr{GET}, 'logs the GET method' );
+ like( $get_log, qr{\Q$base\E}, 'logs the request URL' );
+ like( $get_log, qr{200}, 'logs the 200 status' );
+ like( $get_log, qr{flywheel}, 'logs a response header value' );
+ like( $get_log, qr{banana}, 'logs a body token' );
+
+ # POST with a form body
+ @{$output} = ();
+ my $post = $ua->post_form( $base, { quux => 'zap' } );
+ is( $post->{status}, 200, 'POST returns 200' );
+
+ my $post_log = join "\n", map { $_->{message} } @{$output};
+ like( $post_log, qr{POST}, 'logs the POST method' );
+ like( $post_log, qr{quux}, 'params table shows the form key' );
+
+ # Per-request headers override default_headers (last-wins), and the
+ # overridden header appears exactly once with no duplicate row.
+ @{$output} = ();
+ my $dup_ua = HTTP::Tiny->new(
+ default_headers => { 'X-Dup' => 'from-default' } );
+ my $dup_logger = debug_ua($dup_ua);
+ $dup_logger->text_pre_filter( sub { shift } );
+
+ my $dup_output = [];
+ my $dup_ld = Log::Dispatch->new;
+ $dup_ld->add(
+ Log::Dispatch::Array->new(
+ name => 'dup',
+ min_level => 'debug',
+ array => $dup_output,
+ )
+ );
+ $dup_logger->logger($dup_ld);
+
+ my $dup_get = $dup_ua->get(
+ $base,
+ { headers => { 'X-Dup' => 'from-request' } }
+ );
+ is( $dup_get->{status}, 200, 'override GET returns 200' );
+
+ my $dup_log = join "\n", map { $_->{message} } @{$dup_output};
+ like(
+ $dup_log, qr{from-request},
+ 'per-request header value is logged'
+ );
+ unlike(
+ $dup_log, qr{from-default},
+ 'default header value is overridden, not duplicated'
+ );
+
+ # The logger prints two request-header tables (before and after
+ # sending). 'X-Dup' must appear as a single row in each, i.e. exactly
+ # twice overall and never with a duplicate/merged value row.
+ my @dup_rows = ( $dup_log =~ /^\|\s*X-Dup\s.*$/mg );
+ is( scalar(@dup_rows), 2, 'X-Dup is a single row per request table' );
+ unlike(
+ join( "\n", @dup_rows ),
+ qr{from-default},
+ 'no X-Dup row carries the overridden default value'
+ );
+ },
+ server => sub {
+ my $port = shift;
+ my $app = sub {
+ return [
+ 200,
+ [
+ 'Content-Type' => 'text/html',
+ 'X-LWPCL-Test' => 'flywheel',
+ ],
+ ['<html><body>banana</body></html>'],
+ ];
+ };
+ Plack::Loader->auto( port => $port, host => '127.0.0.1' )->run($app);
+ },
+);
+
+# Error/599 resilience: HTTP::Tiny returns a synthetic 599 response for an
+# unsupported URL scheme rather than dying. The logging wrapper must translate
+# that error response and must not crash the caller.
+{
+ my $ua = HTTP::Tiny->new;
+ my $logger = debug_ua($ua);
+ $logger->text_pre_filter( sub { shift } );
+
+ my $output = [];
+ my $ld = Log::Dispatch->new;
+ $ld->add(
+ Log::Dispatch::Array->new(
+ name => 'err',
+ min_level => 'debug',
+ array => $output,
+ )
+ );
+ $logger->logger($ld);
+
+ my $res = $ua->get('file:///no/such');
+ ok(
+ is_hashref($res),
+ 'error request does not die and returns a hashref'
+ );
+ is( $res->{status}, 599, 'HTTP::Tiny returns a 599 error response' );
+
+ my $err_log = join "\n", map { $_->{message} } @{$output};
+ like( $err_log, qr{599}, 'logger captured the 599 status' );
+}
+
+done_testing();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LWP-ConsoleLogger-1.000002/xt/author/eol.t
new/LWP-ConsoleLogger-1.000003/xt/author/eol.t
--- old/LWP-ConsoleLogger-1.000002/xt/author/eol.t 2026-05-12
19:28:05.000000000 +0200
+++ new/LWP-ConsoleLogger-1.000003/xt/author/eol.t 2026-09-18
16:14:27.000000000 +0200
@@ -21,6 +21,7 @@
't/decode-header-value.t',
't/everywhere-logfile-child.pl',
't/everywhere-logfile.t',
+ 't/http-tiny.t',
't/pretty.t',
't/test-data/content-regex.html',
't/test-data/file-upload.html',
++++++ _scmsync.obsinfo ++++++
--- /var/tmp/diff_new_pack.GWS0DU/_old 2026-11-06 19:49:47.151602608 +0100
+++ /var/tmp/diff_new_pack.GWS0DU/_new 2026-11-06 19:49:47.160602985 +0100
@@ -1,6 +1,6 @@
-mtime: 1778669199
-commit: b51c20c09baf29cfc4294d0476bba92f3fe5947259ea340ab14502af42851d35
+mtime: 1789810415
+commit: 10f769ced7f7c5f3d5af6e916088c8eb3c20b72dc72ad04abf8b6343478942ba
url: https://src.opensuse.org/perl/perl-LWP-ConsoleLogger
-revision: b51c20c09baf29cfc4294d0476bba92f3fe5947259ea340ab14502af42851d35
+revision: 10f769ced7f7c5f3d5af6e916088c8eb3c20b72dc72ad04abf8b6343478942ba
projectscmsync: https://src.opensuse.org/perl/_ObsPrj
++++++ build.specials.obscpio ++++++
++++++ build.specials.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/.gitignore new/.gitignore
--- old/.gitignore 1970-01-01 01:00:00.000000000 +0100
+++ new/.gitignore 2026-09-19 11:33:35.000000000 +0200
@@ -0,0 +1 @@
+.osc