From 469be98bfa075e7c6fe1ac11d87c93502210c9d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Quelin?= Date: Fri, 30 Jan 2009 15:02:00 +0100 Subject: [PATCH] cleaner way of logging new step --- lib/App/CPAN2Pkg/Module.pm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/App/CPAN2Pkg/Module.pm b/lib/App/CPAN2Pkg/Module.pm index aa3ef76..07762b0 100644 --- a/lib/App/CPAN2Pkg/Module.pm +++ b/lib/App/CPAN2Pkg/Module.pm @@ -25,6 +25,8 @@ use POE; use POE::Filter::Line; use POE::Wheel::Run; +my $PREFIX = '*'; + # # if ( not available in cooker ) is_in_dist @@ -236,11 +238,20 @@ sub _start { # -- private methods +sub _log_empty_line { + my ($self, $nb) = @_; + $nb //= 1; #/ FIXME padre syntaxic color glitch + POE::Kernel->post('ui', 'append', $self, "\n" x $nb); +} + sub _log_new_step { my ($self, $k, $step, $comment) = @_; - my $out = "\n\n" . '*' x 10 . "\n$step\n\n$comment\n\n"; - $k->post('ui', 'append', $self, $out); + my @lines = + map { "$PREFIX $_\n" } + ( '-' x 10, $step, '', $comment, '' ); + $k->post('ui', 'append', $self, $_) for @lines; + $self->_log_empty_line; } 1; -- 2.11.4.GIT