Commit 157263d6 authored by Pierre Dittgen's avatar Pierre Dittgen
Browse files

Add logging

parent 7048cd05
# Changelog
## next
- add loggging around browserless.io service call
## 0.4.0a12
- stop using `chromium` to generate PDF report
......
......@@ -32,10 +32,12 @@ class BrowserlessPDFRenderer(PDFRenderer):
"""Browserless IO implementation."""
def __init__(self, api_url: str, api_token: str):
log.info('BrowserlessPDFRenderer(%s,XXX)', api_url)
self.api_url = api_url
self.api_token = api_token
def render(self, url: str):
log.info("BrowserlessPDFRenderer.render(%s)", url)
headers = {
"Cache-Control": "no-cache",
}
......@@ -48,8 +50,12 @@ class BrowserlessPDFRenderer(PDFRenderer):
"format": "A4",
},
}
log.info("BrowserlessPDFRenderer.render data = %r", data)
# Request server
log.info("BrowserlessPDFRenderer.render before post")
r = requests.post(self.api_url, headers=headers, params=params, json=data)
log.info("BrowserlessPDFRenderer.render after post")
r.raise_for_status()
log.info("BrowserlessPDFRenderer.render content size = %d", len(r.content))
return r.content
......@@ -571,6 +571,7 @@ def pdf_report():
**schema_instance.request_parameters(),
}
validation_url = "{}?{}".format(base_url, urlencode(parameter_dict))
log.info("Validation URL = %s", validation_url)
# Ask for PDF report generation
try:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment