Skip to content

Commit

Permalink
Strip color codes for log
Browse files Browse the repository at this point in the history
  • Loading branch information
swelljoe committed Jul 29, 2017
1 parent 1cb806b commit 6b6a211
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Time::HiRes qw( sleep );

# Plugin base class, just runs stuff with spinner and status
use Virtualmin::Config;
use Term::ANSIColor qw(:constants);
use Term::ANSIColor qw(:constants colorstrip);
use Term::Spinner::Color;

# TODO I don't like this, but can't figure out how to put it into
Expand Down Expand Up @@ -59,7 +59,7 @@ sub spin {
RESET . "] " . $message;
my $color_correction = length(YELLOW . RESET . GREEN . RESET);
$count++;
$log->info($message);
$log->info(colorstrip($message));
$spinner = Term::Spinner::Color->new();
$message = $message . " " x (79 - length($message) - $spinner->{'last_size'} + $color_correction);
print $message;
Expand Down

0 comments on commit 6b6a211

Please sign in to comment.