add debug logging to regulator
+import logging
+
from django.conf import settings
from share import exceptions
@@ -5,6 +7,9 @@ from share.models import RegulatorLog
from share.util.extensions import Extensions
+logger = logging.getLogger(__name__)
+
+
class RegulatorConfigError(exceptions.ShareException):
pass
@@ -29,6 +34,8 @@ class Regulator:
self.job = ingest_job
self._logs = []
+ logger.debug(f'>>> {ingest_job!r} -- initializing regulator')
+
if ingest_job and not source_config:
source_config = ingest_job.suid.source_config
@@ -44,6 +51,7 @@ class Regulator:
)
def regulate(self, graph):
+ logger.debug(f'>>> {self.job!r} -- regulating graph')
try:
self._custom_steps.run(graph)
self._default_steps.run(graph)
@@ -91,6 +99,7 @@ class Steps:
def _run_steps(self, graph, steps):
for step in steps:
try:
+ logger.debug(f'>>> {self.regulator.job!r} -- running regulator step {step.__class__.__name__}')
step.run(graph)
finally:
if step.logs:
