From dbb24a676e8a8d96f20a9c1c66fdf5fd08ba1d4c Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 1 Feb 2016 15:36:26 +0100 Subject: [PATCH] Bug 15714: Add get_loglevels to koha-functions.sh Preparing for including different log levels in koha-start-zebra. Note that the default response is none,fatal,warn; this is equal to the options passed to zebrasrv in koha-start-zebra (for now). Test plan: [1] Run on the command line: source koha-functions.sh [2] Type get_loglevels [your_instance] By default, you should see: none,fatal,warn [3] Add this line to your koha-conf: how,are,you [4] Run get_loglevels [your_instance] again. Remove the nonsense log levels again.. Signed-off-by: Mark Tompsett Signed-off-by: Jonathan Druart Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- debian/scripts/koha-functions.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/debian/scripts/koha-functions.sh b/debian/scripts/koha-functions.sh index 5ec633d103..87a84a1819 100755 --- a/debian/scripts/koha-functions.sh +++ b/debian/scripts/koha-functions.sh @@ -159,3 +159,15 @@ get_instances() find /etc/koha/sites -mindepth 1 -maxdepth 1\ -type d -printf '%f\n' | sort } + +get_loglevels() +{ + local instancename=$1 + local retval=$(xmlstarlet sel -t -v 'yazgfs/config/zebra_loglevels' /etc/koha/sites/$instancename/koha-conf.xml) + if [ "$retval" != "" ]; then + echo "$retval" + else + echo "none,fatal,warn" + fi + +} -- 2.39.5