Skip to content

Commit

Permalink
add debug logging to regulator
Browse files Browse the repository at this point in the history
  • Loading branch information
aaxelb committed Jan 12, 2021
1 parent 4e0c3ba commit 51c4385
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions share/regulate/regulator.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import logging

from django.conf import settings

from share import exceptions
from share.models import RegulatorLog
from share.util.extensions import Extensions


logger = logging.getLogger(__name__)


class RegulatorConfigError(exceptions.ShareException):
pass

Expand All @@ -29,6 +34,8 @@ def __init__(
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

Expand All @@ -44,6 +51,7 @@ def __init__(
)

def regulate(self, graph):
logger.debug(f'>>> {self.job!r} -- regulating graph')
try:
self._custom_steps.run(graph)
self._default_steps.run(graph)
Expand Down Expand Up @@ -91,6 +99,7 @@ def run(self, graph):
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:
Expand Down

0 comments on commit 51c4385

Please sign in to comment.