removed debug logs from scodoc7 decorators

This commit is contained in:
Emmanuel Viennet 2021-07-27 17:16:58 +03:00
parent 40d98eae16
commit b8efe15c0a

View File

@ -64,12 +64,12 @@ class ZRequest(object):
elif request.method == "GET":
self.form = {}
for k in request.args:
current_app.logger.debug("%s\t%s" % (k, request.args.getlist(k)))
# current_app.logger.debug("%s\t%s" % (k, request.args.getlist(k)))
if k.endswith(":list"):
self.form[k[:-5]] = request.args.getlist(k)
else:
self.form[k] = request.args[k]
current_app.logger.info("ZRequest.form=%s" % str(self.form))
# current_app.logger.info("ZRequest.form=%s" % str(self.form))
self.RESPONSE = ZResponse()
def __str__(self):
@ -91,7 +91,7 @@ class ZResponse(object):
self.headers = {}
def redirect(self, url):
current_app.logger.debug("ZResponse redirect to:" + str(url))
# current_app.logger.debug("ZResponse redirect to:" + str(url))
return flask.redirect(url) # http 302
def setHeader(self, header, value):
@ -165,7 +165,7 @@ def scodoc7func(context):
pos_arg_values = []
# PY3 à remplacer par inspect.getfullargspec en py3: TODO
argspec = inspect.getargspec(func)
current_app.logger.info("argspec=%s" % str(argspec))
# current_app.logger.info("argspec=%s" % str(argspec))
nb_default_args = len(argspec.defaults) if argspec.defaults else 0
if nb_default_args:
arg_names = argspec.args[:-nb_default_args]
@ -178,8 +178,8 @@ def scodoc7func(context):
pos_arg_values.append(context)
else:
pos_arg_values.append(req_args[arg_name])
current_app.logger.info("pos_arg_values=%s" % pos_arg_values)
current_app.logger.info("req_args=%s" % req_args)
# current_app.logger.info("pos_arg_values=%s" % pos_arg_values)
# current_app.logger.info("req_args=%s" % req_args)
# Add keyword arguments
if nb_default_args:
for arg_name in argspec.args[-nb_default_args:]:
@ -188,10 +188,10 @@ def scodoc7func(context):
elif arg_name in req_args:
# set argument kw optionnel
kwargs[arg_name] = req_args[arg_name]
current_app.logger.info(
"scodoc7func_decorator: top_level=%s, pos_arg_values=%s, kwargs=%s"
% (top_level, pos_arg_values, kwargs)
)
# current_app.logger.info(
# "scodoc7func_decorator: top_level=%s, pos_arg_values=%s, kwargs=%s"
# % (top_level, pos_arg_values, kwargs)
# )
value = func(*pos_arg_values, **kwargs)
if not top_level: