# HG changeset patch # User drewp@bigasterisk.com # Date 1559865849 0 # Node ID 8bf24d5a0d219292d620318cbc0be6c01e19b741 # Parent 8a60c172a14ca9eff181d5c11ceaabaa78d57363 shorter debug log on initial graph sync Ignore-this: 9c1d5e4a920c304203924d4ca5a0acf7 diff -r 8a60c172a14c -r 8bf24d5a0d21 rdfdb/service.py --- a/rdfdb/service.py Fri Jun 07 00:03:20 2019 +0000 +++ b/rdfdb/service.py Fri Jun 07 00:04:09 2019 +0000 @@ -33,7 +33,6 @@ log = logging.getLogger('rdfdb') - class WebsocketDisconnect(ValueError): pass @@ -295,9 +294,8 @@ return g def addClient(self, newClient: WebsocketClient) -> None: - log.info("new connection: sending all graphs to %r..." % newClient) + log.info("new connection: sending all graphs to %r" % newClient) newClient.sendPatch(Patch(addQuads=self.graph.quads(ALLSTMTS), delQuads=[])) - self.clients.append(newClient) stats.clients = len(self.clients) diff -r 8a60c172a14c -r 8bf24d5a0d21 rdfdb/syncedgraph.py --- a/rdfdb/syncedgraph.py Fri Jun 07 00:03:20 2019 +0000 +++ b/rdfdb/syncedgraph.py Fri Jun 07 00:04:09 2019 +0000 @@ -211,7 +211,12 @@ """ central server has sent us a patch """ - log.debug('server has sent us %s', p) + if log.isEnabledFor(logging.DEBUG): + if len(p.addQuads) > 50: + log.debug('server has sent us %s', p.shortSummary()) + else: + log.debug('server has sent us %s', p) + self._applyPatchLocally(p) try: self.runDepsOnNewPatch(p)