call trace only on enabled debug
This commit is contained in:
@@ -384,6 +384,8 @@ class ApplicationPartPropfind(ApplicationBase):
|
||||
for item in items:
|
||||
if isinstance(item, storage.BaseCollection):
|
||||
path = pathutils.unstrip_path(item.path, True)
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
logger.debug("TRACE/PROPFIND/_collect_allowed_items/BaseCollection: path=%r user=%r", path, user)
|
||||
if item.tag:
|
||||
permissions = rights.intersect(
|
||||
self._rights.authorization(user, path), "rw")
|
||||
@@ -440,6 +442,8 @@ class ApplicationPartPropfind(ApplicationBase):
|
||||
logger.debug("Client timed out", exc_info=True)
|
||||
return httputils.REQUEST_TIMEOUT
|
||||
with self._storage.acquire_lock("r", user):
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
logger.debug("TRACE/PROPFIND: discover path=%r depth=%s", path, http_depth)
|
||||
items_iter = iter(self._storage.discover(
|
||||
path, http_depth,
|
||||
None, self._rights._user_groups))
|
||||
|
||||
@@ -242,7 +242,8 @@ def xml_report(base_prefix: str, path: str, xml_request: Optional[ET.Element],
|
||||
filter_copy = copy.deepcopy(filter_)
|
||||
|
||||
if expand is not None:
|
||||
logger.debug("TRACE/REPORT/xml_report: expand")
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
logger.debug("TRACE/REPORT/xml_report: expand")
|
||||
for comp_filter in filter_copy.findall(".//" + xmlutils.make_clark("C:comp-filter")):
|
||||
if comp_filter.get("name", "").upper() == "VCALENDAR":
|
||||
continue
|
||||
@@ -326,13 +327,16 @@ def xml_report(base_prefix: str, path: str, xml_request: Optional[ET.Element],
|
||||
n_vevents += n_vev
|
||||
if prop.tag == xmlutils.make_clark("D:getetag"):
|
||||
if n_vev > 0:
|
||||
logger.debug("TRACE/REPORT/xml_report: getetag/expanded element")
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
logger.debug("TRACE/REPORT/xml_report: getetag/expanded element")
|
||||
element.text = item.etag
|
||||
found_props.append(element)
|
||||
else:
|
||||
logger.debug("TRACE/REPORT/xml_report: getetag/no expanded element")
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
logger.debug("TRACE/REPORT/xml_report: getetag/no expanded element")
|
||||
else:
|
||||
logger.debug("TRACE/REPORT/xml_report: default")
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
logger.debug("TRACE/REPORT/xml_report: default")
|
||||
found_props.append(expanded_element)
|
||||
else:
|
||||
if prop.tag == xmlutils.make_clark("D:getetag"):
|
||||
@@ -776,7 +780,8 @@ def retrieve_items(
|
||||
else:
|
||||
yield item, False
|
||||
if collection_requested:
|
||||
logger.debug("TRACE/REPORT/retrieve_items: get_filtered")
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
logger.debug("TRACE/REPORT/retrieve_items: get_filtered")
|
||||
yield from collection.get_filtered(filters)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user