Subject: | regression: ::Screen output does not go to stdout with 2.47 |
This release broke the use of Log::Dispatch::Screen in Dist::Zilla:
https://metacpan.org/diff/file?target=DROLSKY%2FLog-Dispatch-2.47%2F&source=DROLSKY%2FLog-Dispatch-2.46%2F
Specifically, $zilla->log(...) when used inside Dist::Zilla::App::Tester no longer sends its output to stdout to be captured.
Here is the Log::Dispatch object under 2.46, which works:
# bless( {
# 'outputs' => {
# 'self' => bless( {
# 'array' => [
# {
# 'level' => 'info',
# 'message' => 'Foo::Bar',
# 'name' => 'self'
# }
# ],
# 'level_names' => [
# 'debug',
# 'info',
# 'notice',
# 'warning',
# 'error',
# 'critical',
# 'alert',
# 'emergency'
# ],
# 'level_numbers' => {
# 'alert' => 6,
# 'crit' => 5,
# 'critical' => 5,
# 'debug' => 0,
# 'emerg' => 7,
# 'emergency' => 7,
# 'err' => 4,
# 'error' => 4,
# 'info' => 1,
# 'notice' => 2,
# 'warn' => 3,
# 'warning' => 3
# },
# 'max_level' => 7,
# 'min_level' => 0,
# 'name' => 'self'
# }, 'Log::Dispatch::Array' ),
# 'stdout' => bless( {
# 'callbacks' => [
# sub {
# package Log::Dispatchouli;
# use warnings;
# use strict;
# my(%arg) = @_;
# "$arg{'message'}\n";
# }
# ],
# 'level_names' => $VAR1->{'outputs'}{'self'}{'level_names'},
# 'level_numbers' => $VAR1->{'outputs'}{'self'}{'level_numbers'},
# 'max_level' => 1,
# 'min_level' => 0,
# 'name' => 'stdout',
# 'stderr' => 0
# }, 'Log::Dispatch::Screen' )
# }
# }, 'Log::Dispatch' )
and from the failing path, in 2.47:
# here is the LD object: bless( {
# 'outputs' => {
# 'self' => bless( {
# 'array' => [
# {
# 'level' => 'info',
# 'message' => 'Foo::Bar',
# 'name' => 'self'
# }
# ],
# 'level_names' => [
# 'debug',
# 'info',
# 'notice',
# 'warning',
# 'error',
# 'critical',
# 'alert',
# 'emergency'
# ],
# 'level_numbers' => {
# 'alert' => 6,
# 'crit' => 5,
# 'critical' => 5,
# 'debug' => 0,
# 'emerg' => 7,
# 'emergency' => 7,
# 'err' => 4,
# 'error' => 4,
# 'info' => 1,
# 'notice' => 2,
# 'warn' => 3,
# 'warning' => 3
# },
# 'max_level' => 7,
# 'min_level' => 0,
# 'name' => 'self'
# }, 'Log::Dispatch::Array' ),
# 'stdout' => bless( {
# 'callbacks' => [
# sub {
# package Log::Dispatchouli;
# use warnings;
# use strict;
# my(%arg) = @_;
# "$arg{'message'}\n";
# }
# ],
# 'fh' => bless( \*Symbol::GEN2, 'IO::Handle' ),
# 'level_names' => $VAR1->{'outputs'}{'self'}{'level_names'},
# 'level_numbers' => $VAR1->{'outputs'}{'self'}{'level_numbers'},
# 'max_level' => 1,
# 'min_level' => 0,
# 'name' => 'stdout'
# }, 'Log::Dispatch::Screen' )
# }
# }, 'Log::Dispatch' )
The diff is:
# bless( {
# 'outputs' => {
# 'self' => bless( {
@@ -50,13 +55,15 @@
# "$arg{'message'}\n";
# }
# ],
+# 'fh' => bless( \*Symbol::GEN2, 'IO::Handle' ),
# 'level_names' => $VAR1->{'outputs'}{'self'}{'level_names'},
# 'level_numbers' => $VAR1->{'outputs'}{'self'}{'level_numbers'},
# 'max_level' => 1,
# 'min_level' => 0,
-# 'name' => 'stdout',
-# 'stderr' => 0
+# 'name' => 'stdout'
# }, 'Log::Dispatch::Screen' )
# }
# }, 'Log::Dispatch' )
The Log::Dispatchouli object is being constructed thusly:
return Log::Dispatchouli->new({
ident => 'Dist::Zilla',
to_stdout => 1,
log_pid => 0,
to_self => 1,
quiet_fatal => 'stdout',
});