Skip to content

Commit

Permalink
Improve regexes for log-file error and warning counts
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusbagpuss authored Sep 2, 2024
1 parent 13ec507 commit 197e472
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions mysqltuner.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1590,12 +1590,9 @@ sub log_file_recommendations {
while ( my $logLi = <$fh> ) {
chomp $logLi;
$numLi++;
debugprint "$numLi: $logLi"
if $logLi =~ /warning|error/i and $logLi !~ /Logging to/;
$nbErrLog++
if $logLi =~ /error/i
and $logLi !~ /(Logging to|\[Warning\].*ERROR_FOR_DIVISION_BY_ZERO)/;
$nbWarnLog++ if $logLi =~ /warning/i;
debugprint "$numLi: $logLi" if $logLi =~ /\[(warning|error)\]/i;
$nbErrLog++ if $logLi =~ /\[error\]/i;
$nbWarnLog++ if $logLi =~ /\[warning\]/i;
push @lastShutdowns, $logLi
if $logLi =~ /Shutdown complete/ and $logLi !~ /Innodb/i;
push @lastStarts, $logLi if $logLi =~ /ready for connections/;
Expand Down

0 comments on commit 197e472

Please sign in to comment.