Skip to content

Commit

Permalink
Added Rex::Logger::warn(), Rex::Logger::error(), Rex::Logger::logger()
Browse files Browse the repository at this point in the history
  • Loading branch information
kablamo committed Dec 2, 2015
1 parent bef1890 commit 321ca8a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/Rex/Logger.pm
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ package Rex::Logger;

use strict;
use warnings;
use Exporter::Shiny qw/debug info warn error/;

# VERSION

#use Rex;

our $no_color = 0;
eval "use Term::ANSIColor";
if ($@) { $no_color = 1; }
Expand Down Expand Up @@ -105,7 +104,7 @@ sub init {
$log_opened = 1;
}

sub info {
sub logger {
my ( $msg, $type ) = @_;
my $color = 'green';

Expand Down Expand Up @@ -171,6 +170,10 @@ sub info {
}
}

sub warn { logger( shift, "warn" ) }
sub error { logger( shift, "error" ) }
sub info { logger( shift, "info" ) }

sub debug {
my ($msg) = @_;
return if $silent;
Expand Down

0 comments on commit 321ca8a

Please sign in to comment.