Skip to content

Commit

Permalink
Add rudimentry debug logging to odo.
Browse files Browse the repository at this point in the history
  • Loading branch information
groutr committed Dec 15, 2016
1 parent 0528711 commit 279b889
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion odo/core.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import absolute_import, division, print_function

import logging
from collections import namedtuple
from contextlib import contextmanager
from warnings import warn
Expand All @@ -10,6 +11,7 @@
from .compatibility import map
from .utils import expand_tuples, ignoring

log = logging.getLogger(__name__)

ooc_types = set() # Out-of-Core types

Expand Down Expand Up @@ -101,11 +103,16 @@ def _transform(graph, target, source, excluded_edges=None, ooc_types=ooc_types,
path_proxy = IterProxy(pth)
for convert_from, convert_to, f, cost in path_proxy:
try:
log.debug('Transforming %s -> %s', A.__name__, B.__name__,
extra={'kwargs': kwargs, 'f': f, 'excluded_edges': excluded_edges}
)
x = f(x, excluded_edges=excluded_edges, **kwargs)
except NotImplementedError as e:
if kwargs.get('raise_on_errors'):
raise
warn(FailedConversionWarning(convert_from, convert_to, e))
log.warning('Failed on %s -> %s. Working around\nError message:\n%s',
A.__name__, B.__name__, e
)

# exclude the broken edge
excluded_edges |= {(convert_from, convert_to)}
Expand Down

0 comments on commit 279b889

Please sign in to comment.