<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From dfd34a59531c4ed8a5468c67b4ed02a00c5d89ee Mon Sep 17 00:00:00 2001
From: Slaven Rezic &lt;slaven@rezic.de&gt;
Date: Tue, 22 Aug 2017 15:48:52 +0200
Subject: [PATCH] adapt callback prepending for Log::Dispatch 2.59+ (RT
 #120329)

Also remove special handling for newline option --- newer Log::Dispatch
have this already built in.
---
 Makefile.PL                      |  2 +-
 lib/Log/Dispatch/Screen/Color.pm | 22 +++-------------------
 2 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/Makefile.PL b/Makefile.PL
index 50ac9f6..55a63ee 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -2,7 +2,7 @@ use inc::Module::Install;
 name 'Log-Dispatch-Screen-Color';
 all_from 'lib/Log/Dispatch/Screen/Color.pm';
 
-requires 'Log::Dispatch';
+requires 'Log::Dispatch' =&gt; 2.59;
 requires 'Term::ANSIColor';
 requires 'Params::Validate';
 requires 'Win32::Console::ANSI' if $^O eq 'MSWin32';
diff --git a/lib/Log/Dispatch/Screen/Color.pm b/lib/Log/Dispatch/Screen/Color.pm
index b00c3c5..cc28c44 100644
--- a/lib/Log/Dispatch/Screen/Color.pm
+++ b/lib/Log/Dispatch/Screen/Color.pm
@@ -2,7 +2,7 @@ package Log::Dispatch::Screen::Color;
 use strict;
 use warnings;
 use base 'Log::Dispatch::Screen';
-our $VERSION = '0.04';
+our $VERSION = '0.04_50';
 
 use Params::Validate qw(validate HASHREF BOOLEAN);
 Params::Validate::validation_options( allow_extra =&gt; 1 );
@@ -58,11 +58,6 @@ sub new {
             optional =&gt; 1,
             default  =&gt; +{},
         },
-        newline =&gt; {
-            type =&gt; BOOLEAN,
-            optional =&gt; 1,
-            default =&gt; 0,
-        },
     });
 
     # generate color table
@@ -77,14 +72,8 @@ sub new {
     }
     $self-&gt;{color} = $color;
 
-    # inject color callback
-    my @callbacks      = $self-&gt;_get_callbacks(%p);
-    $self-&gt;{callbacks} = [ sub { $self-&gt;colored(@_) }, @callbacks ];
-
-    # newline
-    if ($p{newline}) {
-        push @{$self-&gt;{callbacks}}, \&amp;_add_newline_callback;
-    }
+    # inject color callback XXX should use prepend_callback() which does not exist. See also https://rt.cpan.org/Ticket/Display.html?id=120329
+    $self-&gt;{callbacks} = [ sub { $self-&gt;colored(@_) }, $self-&gt;{callbacks} ? @{ $self-&gt;{callbacks} } : () ];
 
     $self;
 }
@@ -115,11 +104,6 @@ sub colored {
     return $message;
 }
 
-sub _add_newline_callback {
-    my %p = @_;
-    return $p{message} . "\n";
-}
-
 
 1;
 __END__
-- 
2.7.4

</pre></body></html>