qprint/dprint_func_templates to use get_stack_var

Change qprint_func_template and dprint_func_template to use get_stack_var to
obtain quiet and debug variable values.

This means that they will search upward in the stack for the first such
qualifying variable.

In other words, when calling qprint functions, the local value of quiet will
be used.  If there is no local value, the caller's local value of quiet will
be used and so on, all the way up the stack.

Change-Id: I275e483d8baf22b1acfaa64442e051bb53fdd518
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/lib/gen_print.py b/lib/gen_print.py
index 8f97791..1ccde52 100755
--- a/lib/gen_print.py
+++ b/lib/gen_print.py
@@ -1786,13 +1786,16 @@
 
 qprint_func_template = \
     [
-        "    if int(<mod_qualifier>get_var_value(None, 0, \"quiet\")): return"
+        "    quiet_default = <mod_qualifier>get_var_value(None, 0, \"quiet\")",
+        "    quiet = <mod_qualifier>get_stack_var(\"quiet\", quiet_default)",
+        "    if int(quiet): return"
     ] + print_func_template
 
 dprint_func_template = \
     [
-        "    if not int(<mod_qualifier>get_var_value(None, 0, \"debug\")):"
-        + " return"
+        "    debug_default = <mod_qualifier>get_var_value(None, 0, \"debug\")",
+        "    debug = <mod_qualifier>get_stack_var(\"debug\", debug_default)",
+        "    if not int(debug): return"
     ] + print_func_template
 
 lprint_func_template = \