From b3f8235dd1b33f51313b788dc06b389758415b34 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 --- 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 5ec633d..87a84a1 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.7.0