Skip to content

Commit

Permalink
mldistwatch: fix logging for uninteresting files
Browse files Browse the repository at this point in the history
First, "1" is not a reason.  Return a string.

Secondly, do not log this string by default.  It is boring.

This is substandard work, but further work will just complicate the
PAUSE::Indexer::Context work, which will make fixing this in a really
nice way easy!
  • Loading branch information
rjbs committed May 5, 2024
1 parent a0b103f commit a7bcdc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/PAUSE/dist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ sub ignoredist {
return 1;
}

return 1 if $dist =~ /(\.readme|\.sig|\.meta|CHECKSUMS)$/;
return "non-dist file" if $dist =~ /(\.readme|\.sig|\.meta|CHECKSUMS)$/;

# Stupid to have code that needs to be maintained in two places,
# here and in edit.pm:
Expand Down
4 changes: 3 additions & 1 deletion lib/PAUSE/mldistwatch.pm
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,9 @@ sub maybe_index_dist {
if (my $skip_reason = $self->reason_to_skip_dist($dio)) {
# We don't log on $OLD_UNCHANGED_FILE because it's extremely common and
# leads to noise in the logs. -- rjbs, 2024-04-28
my $log_method = $skip_reason eq $OLD_UNCHANGED_FILE ? 'log_debug' : 'log';
my $log_method = $skip_reason eq $OLD_UNCHANGED_FILE ? 'log_debug'
: $skip_reason eq "non-dist file" ? 'log_debug'
: 'log';
$Logger->$log_method("skipping: $skip_reason");

delete $self->{ALLlasttime}{$dist};
Expand Down

0 comments on commit a7bcdc2

Please sign in to comment.