Skip to content

Commit 279b889

Browse files
committed
Add rudimentry debug logging to odo.
1 parent 0528711 commit 279b889

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

odo/core.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import absolute_import, division, print_function
22

3+
import logging
34
from collections import namedtuple
45
from contextlib import contextmanager
56
from warnings import warn
@@ -10,6 +11,7 @@
1011
from .compatibility import map
1112
from .utils import expand_tuples, ignoring
1213

14+
log = logging.getLogger(__name__)
1315

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

@@ -101,11 +103,16 @@ def _transform(graph, target, source, excluded_edges=None, ooc_types=ooc_types,
101103
path_proxy = IterProxy(pth)
102104
for convert_from, convert_to, f, cost in path_proxy:
103105
try:
106+
log.debug('Transforming %s -> %s', A.__name__, B.__name__,
107+
extra={'kwargs': kwargs, 'f': f, 'excluded_edges': excluded_edges}
108+
)
104109
x = f(x, excluded_edges=excluded_edges, **kwargs)
105110
except NotImplementedError as e:
106111
if kwargs.get('raise_on_errors'):
107112
raise
108-
warn(FailedConversionWarning(convert_from, convert_to, e))
113+
log.warning('Failed on %s -> %s. Working around\nError message:\n%s',
114+
A.__name__, B.__name__, e
115+
)
109116

110117
# exclude the broken edge
111118
excluded_edges |= {(convert_from, convert_to)}

0 commit comments

Comments
 (0)