Improve regexes for log-file error and warning counts

This commit is contained in:
John Salter 2024-09-02 18:27:59 +01:00 committed by GitHub
parent 13ec5072fb
commit 197e4729b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1590,12 +1590,9 @@ sub log_file_recommendations {
while ( my $logLi = <$fh> ) { while ( my $logLi = <$fh> ) {
chomp $logLi; chomp $logLi;
$numLi++; $numLi++;
debugprint "$numLi: $logLi" debugprint "$numLi: $logLi" if $logLi =~ /\[(warning|error)\]/i;
if $logLi =~ /warning|error/i and $logLi !~ /Logging to/; $nbErrLog++ if $logLi =~ /\[error\]/i;
$nbErrLog++ $nbWarnLog++ if $logLi =~ /\[warning\]/i;
if $logLi =~ /error/i
and $logLi !~ /(Logging to|\[Warning\].*ERROR_FOR_DIVISION_BY_ZERO)/;
$nbWarnLog++ if $logLi =~ /warning/i;
push @lastShutdowns, $logLi push @lastShutdowns, $logLi
if $logLi =~ /Shutdown complete/ and $logLi !~ /Innodb/i; if $logLi =~ /Shutdown complete/ and $logLi !~ /Innodb/i;
push @lastStarts, $logLi if $logLi =~ /ready for connections/; push @lastStarts, $logLi if $logLi =~ /ready for connections/;