Skip to content

Commit 6626264

Browse files
committed
Instance: optional extra pattern for _check_syslog
1 parent 55a1f4e commit 6626264

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Diff for: cassandane/Cassandane/Instance.pm

+11-2
Original file line numberDiff line numberDiff line change
@@ -1501,9 +1501,18 @@ sub _check_sanity
15011501

15021502
sub _check_syslog
15031503
{
1504-
my ($self) = @_;
1504+
my ($self, $pattern) = @_;
1505+
1506+
if (defined $pattern) {
1507+
# pattern is optional but must be a regex if present
1508+
die "getsyslog: pattern is not a regular expression"
1509+
if lc ref($pattern) ne 'regexp';
1510+
}
15051511

1506-
my @errors = $self->getsyslog(qr/ERROR|TRACELOG|Unknown code ____/);
1512+
my @lines = $self->getsyslog();
1513+
my @errors = grep {
1514+
m/ERROR|TRACELOG|Unknown code ____/ || ($pattern && m/$pattern/)
1515+
} @lines;
15071516

15081517
@errors = grep { not m/DBERROR.*skipstamp/ } @errors;
15091518

0 commit comments

Comments
 (0)