Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Item14384: minor improvement to reporting
  • Loading branch information
cdot committed May 8, 2017
1 parent 232699b commit 50e0d3f
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions lib/Foswiki/Plugins/PublishPlugin/Publisher.pm
Expand Up @@ -653,26 +653,32 @@ sub arrayDiff {
return @difference;
}

sub logInfo {
sub _log {
my $this = shift;

&{ $this->{logfn} }( "info", @_ );
$this->{historyText} .= join( '', @_ ) . "%BR%\n"
my $level = shift;
my $preamble = shift;

&{ $this->{logfn} }( $level, @_ );
$this->{historyText} .=
join( '', $preamble, @_,
($preamble ? '%ENDCOLOR$' : ''),
'%BR%\n')
if ( $this->{opt}->{history} );
}

sub logInfo {
my $this = shift;
$this->_log('info', '', @_);
}

sub logWarn {
my ( $this, $message ) = @_;
&{ $this->{logfn} }( "warn", @_ );
$this->{historyText} .= "%ORANGE% *WARNING* $message %ENDCOLOR%%BR%\n"
if ( $this->{opt}->{history} );
my $this = shift;
$this->_log( 'warn', '%ORANGE% *WARNING* ', @_ );
}

sub logError {
my ( $this, $message ) = @_;
&{ $this->{logfn} }( "error", @_ );
$this->{historyText} .= "%RED% *ERROR* $message %ENDCOLOR%%BR%\n"
if ( $this->{opt}->{history} );
my $this = shift;
$this->_log( 'error', '%RED% *ERROR* ', @_ );
}

# Publish one topic from web.
Expand Down Expand Up @@ -772,7 +778,10 @@ sub _publishTopic {
$tmpl = $alt_tmpl;
}
else {
$this->logWarn("The VIEW_TEMPLATE is empty - ignoring");
$this->logWarn("The VIEW_TEMPLATE '", $override,
"' is empty for skin ",
$this->{opt}->{publishskin},
"- ignoring");
}
}

Expand Down

0 comments on commit 50e0d3f

Please sign in to comment.