Skip to content

Commit

Permalink
Merge pull request #761 from nationalarchives/add-debug-logging
Browse files Browse the repository at this point in the history
Add DEBUG logging
  • Loading branch information
dragon-dxw authored Nov 7, 2024
2 parents 0f6ff76 + e0a67cf commit 6952fd2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/caselawclient/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
VERSION = "0"
DEFAULT_USER_AGENT = f"ds-caselaw-marklogic-api-client/{VERSION}"

DEBUG: bool = bool(os.getenv("DEBUG", default=False))


class NoResponse(Exception):
"""A requests HTTPError has no response. We expect this will never happen."""
Expand Down Expand Up @@ -728,6 +730,10 @@ def eval(
"vars": vars,
}
path = "LATEST/eval"

if DEBUG:
print(f"Sending {vars} to {xquery_path}")

response = self.session.request(
"POST",
url=self._path_to_request_url(path),
Expand Down

0 comments on commit 6952fd2

Please sign in to comment.