Skip to content

Commit 321ca8a

Browse files
committed
Added Rex::Logger::warn(), Rex::Logger::error(), Rex::Logger::logger()
1 parent bef1890 commit 321ca8a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/Rex/Logger.pm

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ package Rex::Logger;
3232

3333
use strict;
3434
use warnings;
35+
use Exporter::Shiny qw/debug info warn error/;
3536

3637
# VERSION
3738

38-
#use Rex;
39-
4039
our $no_color = 0;
4140
eval "use Term::ANSIColor";
4241
if ($@) { $no_color = 1; }
@@ -105,7 +104,7 @@ sub init {
105104
$log_opened = 1;
106105
}
107106

108-
sub info {
107+
sub logger {
109108
my ( $msg, $type ) = @_;
110109
my $color = 'green';
111110

@@ -171,6 +170,10 @@ sub info {
171170
}
172171
}
173172

173+
sub warn { logger( shift, "warn" ) }
174+
sub error { logger( shift, "error" ) }
175+
sub info { logger( shift, "info" ) }
176+
174177
sub debug {
175178
my ($msg) = @_;
176179
return if $silent;

0 commit comments

Comments
 (0)