changeset 137:ae6821e203ac

junky shortener for debug logs
author drewp@bigasterisk.com
date Thu, 01 Jun 2023 14:03:31 -0700
parents 8fa6a47521d7
children a0ba822690f4
files rdfdb/shared_graph.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rdfdb/shared_graph.py	Thu Jun 01 14:03:02 2023 -0700
+++ b/rdfdb/shared_graph.py	Thu Jun 01 14:03:31 2023 -0700
@@ -57,10 +57,13 @@
             return
         log.info("patching graph %s %s" % (ctx, patch.shortSummary()))
         if log.isEnabledFor(logging.DEBUG):
+            def sterm(s): return s.replace('rdflib.term.', '').replace('http://light9.bigasterisk.com', ':')
+            def shorten(quad):
+                return f'{sterm(quad[0])} {sterm(quad[1])} {sterm(quad[2])} {sterm(quad[3])}'
             for q in patch.delQuads:
-                log.debug(f'- {q}')
+                log.debug(f'- {shorten(q)}')
             for q in patch.addQuads:
-                log.debug(f'+ {q}')
+                log.debug(f'+ {shorten(q)}')
         # if hasattr(self, 'watchedFiles'):  # todo: eliminate this
         #     self.watchedFiles.aboutToPatch(ctx)