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 4d9069e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 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
8 changes: 5 additions & 3 deletions lib/PAUSE/mldistwatch.pm
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,11 @@ sub maybe_index_dist {
local $Logger = $Logger->proxy({ proxy_prefix => "$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';
# We don't log on a few things that are extremely common and lead to
# noise in the logs. -- rjbs, 2024-04-28
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 4d9069e

Please sign in to comment.