Skip to content

Commit dae2aab

Browse files
committed
ES - support dev mode
1 parent 5594c0b commit dae2aab

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/MetaCPAN/ES.pm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ use v5.36;
77
use MetaCPAN::Logger qw< :log :dlog >;
88
use Search::Elasticsearch;
99

10-
use MetaCPAN::Ingest qw< config handle_error >;
10+
use MetaCPAN::Ingest qw< config handle_error is_dev >;
1111

1212
sub new ( $class, %args ) {
13-
my $mode = $args{mode} // "local";
1413
my $node = $args{node};
15-
my $index = $args{index} // "cpan";
14+
my $index = $args{index} // 'cpan';
15+
16+
my $mode = is_dev() ? 'test' : 'local';
17+
$mode eq 'test' and Log::Log4perl::init('log4perl_test.conf'); # TODO: find a better place
1618

1719
my $config = config;
1820
my $config_node =

log4perl_test.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
log4perl.logger = OFF

0 commit comments

Comments
 (0)