Bugzilla – Attachment 142016 Details for
Bug 28555
Improve output of verbose option for overdue_notices.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28555: Improve logging for overdue_notices.pl
Bug-28555-Improve-logging-for-overduenoticespl.patch (text/plain), 3.80 KB, created by
Katrin Fischer
on 2022-10-17 19:06:30 UTC
(
hide
)
Description:
Bug 28555: Improve logging for overdue_notices.pl
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2022-10-17 19:06:30 UTC
Size:
3.80 KB
patch
obsolete
>From ac7a6d5935729eb1392fae0c50d561dee4d001c3 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 11 Jun 2021 15:12:32 +0000 >Subject: [PATCH] Bug 28555: Improve logging for overdue_notices.pl > >Currenlty the output with -v from overdue_notices is a bit overwhelming and hard to parse > >I do a few things here: >1 - Only show SQL if verbose > 1 >2 - Add some separators to make it more readab;e >3 - Remove some redundant messages with branchcode and borrowernumber > >To test: >1: perl misc/cronjobs/overdue_notices.pl -v >2: Notice you get a LOT of information all smushed together >3: Apply patch >4: perl misc/cronjobs/overdue_notices.pl -v >5: Less info, and easier to read >6: perl misc/cronjobs/overdue_notices.pl -v -v >7: All the info, but nicer to read > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > misc/cronjobs/overdue_notices.pl | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > >diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl >index 3eca0337df..3a58d1196b 100755 >--- a/misc/cronjobs/overdue_notices.pl >+++ b/misc/cronjobs/overdue_notices.pl >@@ -470,6 +470,7 @@ foreach my $branchcode (@branches) { > || $library->inbound_email_address; > my @output_chunks; # may be sent to mail or stdout or csv file. > >+ $verbose and print "======================================\n"; > $verbose and warn sprintf "branchcode : '%s' using %s\n", $branchcode, $branch_email_address; > > my $sql2 = <<"END_SQL"; >@@ -524,9 +525,10 @@ END_SQL > next unless defined $mindays; > > if ( !$overdue_rules->{"letter$i"} ) { >- $verbose and warn "No letter$i code for branch '$branchcode'"; >+ $verbose and warn sprintf "No letter code found for pass %s\n", $i; > next PERIOD; > } >+ $verbose and warn sprintf "Using letter code '%s' for pass %s\n", $overdue_rules->{"letter$i"}, $i; > > # $letter->{'content'} is the text of the mail that is sent. > # this text contains fields that are replaced by their value. Those fields must be written between brackets >@@ -562,7 +564,12 @@ END_SQL > my $sth = $dbh->prepare($borrower_sql); > $sth->execute(@borrower_parameters); > >- $verbose and warn $borrower_sql . "\n $branchcode | " . $overdue_rules->{'categorycode'} . "\n ($mindays, $maxdays, ". $date_to_run->datetime() .")\nreturns " . $sth->rows . " rows"; >+ if ( $verbose > 1 ){ >+ warn sprintf "--------Borrower SQL------\n"; >+ warn $borrower_sql . "\n $branchcode | " . $overdue_rules->{'categorycode'} . "\n ($mindays, $maxdays, ". $date_to_run->datetime() .")\n"; >+ warn sprintf "--------------------------\n"; >+ } >+ $verbose and warn sprintf "Found %s borrowers with overdues\n", $sth->rows; > my $borrowernumber; > while ( my $data = $sth->fetchrow_hashref ) { > >@@ -602,8 +609,7 @@ END_SQL > $data->{'firstname'} && $data->{'surname'} ? ', ' : '', > $data->{'firstname'} || '', > $borrowernumber ); >- $verbose >- and warn "borrower $borr has items triggering level $i."; >+ $verbose and warn "borrower $borr has items triggering level $i.\n"; > > my $patron = Koha::Patrons->find( $borrowernumber ); > @emails_to_use = (); >@@ -649,7 +655,6 @@ END_SQL > $verbose and warn "debarring $borr\n"; > } > my @params = ($borrowernumber,$branchcode); >- $verbose and warn "STH2 PARAMS: borrowernumber = $borrowernumber"; > > $sth2->execute(@params); > my $itemcount = 0; >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28555
:
121855
|
134076
|
140968
|
141726
|
142001
| 142016 |
142017
|
142018