We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 55a1f4e commit 6626264Copy full SHA for 6626264
cassandane/Cassandane/Instance.pm
@@ -1501,9 +1501,18 @@ sub _check_sanity
1501
1502
sub _check_syslog
1503
{
1504
- my ($self) = @_;
+ 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
+ }
1511
- 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;
1516
1517
@errors = grep { not m/DBERROR.*skipstamp/ } @errors;
1518
0 commit comments