Bug 35479: (follow-up) Match formatting for other cronjob logs

To test:
1 - Install the Kitchen Sink plugin
2 - Restart all
3 - Enable 'CronjobLog' system preference
4 - perl misc/cronjobs/plugins_nightly.pl
5 - Note you see on the command line 'Remember to clean the kitchen' - this indicates the plugin cron ran
6 - Tools->log viewer, select 'cronjob' and view
7 - Note you only see 'plugins_nightly.pl' Run and End lines
8 - Apply patches
9 - perl misc/cronjobs/plugins_nightly.pl
10 - View logs agian
11 - Note you now see Run and End lines for 'Koha::Plugin::Com::ByWaterSolutions::KitchenSink'
12 - Confirm they look like the other lines
13 - Edit KitchenSink.pm and add 'die "Kittens";' to the cronjob nightly
14 - perl misc/cronjobs/plugins_nightly.pl
15 - View logs, confirm there is a FAILED error message for the KitchenSink cron

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ea30aaff62)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Nick Clemens 2023-12-05 13:40:48 +00:00 committed by Fridolin Somers
parent c0d2ee4c07
commit c998c57631

View file

@ -24,12 +24,12 @@ if ( C4::Context->config("enable_plugins") ) {
foreach my $plugin (@plugins) {
my $plugin_name = ref $plugin;
try {
cronlogaction({ info => "running nightly cronjob for plugin $plugin_name" });
cronlogaction({ info => "$plugin_name" });
$plugin->cronjob_nightly();
cronlogaction({ info => "finished nightly cronjob for plugin $plugin_name" });
cronlogaction({ action => "End", info => "$plugin_name COMPLETED" });
}
catch {
cronlogaction({ info => "failed to running nightly cronjob for plugin $plugin_name with error: $_" });
cronlogaction({ action => "Error", info => "$plugin_name FAILED with error: $_" });
warn "$_";
$logger->warn("$_");
};