From 3a2fcc69a8eb4237b2862b3e291971d38748f115 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Mon, 7 Jan 2019 10:41:45 +0100 Subject: Log Chrome’s responses to WARC by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We may not be able to reproduce every failure, so logging as much as possible is important to figure out what went wrong. Also, in case a bug is uncovered in the future, we can check the logs and possibly fix it with -errata. --- crocoite/behavior.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'crocoite/behavior.py') diff --git a/crocoite/behavior.py b/crocoite/behavior.py index 2c94bb8..3ecc92f 100644 --- a/crocoite/behavior.py +++ b/crocoite/behavior.py @@ -131,6 +131,8 @@ class JsOnload (Behavior): # parameter. # XXX: is there a better way to do this? result = await tab.Runtime.evaluate (expression=str (self.script)) + self.logger.debug ('behavior onload inject', + uuid='a2da9b78-5648-44c5-bfa8-5c7573e13ad3', result=result) exception = result.get ('exceptionDetails', None) result = result['result'] assert result['type'] == 'function', result @@ -143,6 +145,8 @@ class JsOnload (Behavior): functionDeclaration='function(options){return new this(options);}', objectId=constructor, arguments=[{'value': self.options}]) + self.logger.debug ('behavior onload start', + uuid='6c0605ae-93b3-46b3-b575-ba45790909a7', result=result) result = result['result'] assert result['type'] == 'object', result assert result.get ('subtype') != 'error', result @@ -160,8 +164,7 @@ class JsOnload (Behavior): self.logger.error ('jsonload onstop failed', uuid='1786726f-c8ec-4f79-8769-30954d4e32f5', exception=e.args, - objectId=self.context, - context=self.__class__.__name__) + objectId=self.context) return yield # pragma: no cover @@ -238,6 +241,8 @@ class DomSnapshot (Behavior): viewport = await getFormattedViewportMetrics (tab) dom = await tab.DOM.getDocument (depth=-1, pierce=True) + self.logger.debug ('dom snapshot document', + uuid='0c720784-8bd1-4fdc-a811-84394d753539', dom=dom) haveUrls = set () for doc in ChromeTreeWalker (dom['root']).split (): url = URL (doc['documentURL']) -- cgit v1.2.3