From 716e04a6b172441245556c2626273f064ca7e170 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 24 Nov 2021 16:11:32 +0100 Subject: [PATCH] #8224 Fixed print_log --- pandora_server/util/pandora_manage.pl | 38 +++++++++++++-------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 1480decba4..cbaa4d88c0 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -343,6 +343,23 @@ sub update_conf_txt ($$$$) { return $result; } +############################################################################### +############################################################################### +# PRINT HELP AND CHECK ERRORS FUNCTIONS +############################################################################### +############################################################################### + +############################################################################### +# log wrapper +############################################################################### +sub print_log ($) { + my ($msg) = @_; + + print $msg; # show message + + $msg =~ s/\n+$//; + logger( $conf, "($progname) $msg", 10); # save to logging file +} ############################################################################### # Disable a entire group @@ -986,7 +1003,7 @@ sub pandora_get_calendar_id ($$) { sub pandora_get_same_day_id ($$) { my ($dbh, $same_day) = @_; - my $weeks = { 'monday' => 1, 'tuesday' => 2, 'wednesday' => 3, 'thursday' => 4, 'friday' => 5, 'saturday' => 6, 'sunday' => 7, 'holiday' => 8}; + my %weeks = ('monday' => 1, 'tuesday' => 2, 'wednesday' => 3, 'thursday' => 4, 'friday' => 5, 'saturday' => 6, 'sunday' => 7, 'holiday' => 8); return defined ($weeks{$same_day}) ? $weeks{$same_day} : -1; } @@ -1008,25 +1025,6 @@ sub pandora_delete_special_day ($$) { } } - -############################################################################### -############################################################################### -# PRINT HELP AND CHECK ERRORS FUNCTIONS -############################################################################### -############################################################################### - -############################################################################### -# log wrapper -############################################################################### -sub print_log ($) { - my ($msg) = @_; - - print $msg; # show message - - $msg =~ s/\n+$//; - logger( $conf, "($progname) $msg", 10); # save to logging file -} - ############################################################################### # Print a parameter error and exit the program. ###############################################################################