Skip to content

Commit e921d06

Browse files
committed
fail_silently log to debug
1 parent 1a70415 commit e921d06

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ellar/di/utils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
import logging
12
import typing as t
23

4+
logger = logging.getLogger("ellar")
5+
36

47
@t.no_type_check
58
def fail_silently(func: t.Callable, *args: t.Any, **kwargs: t.Any) -> t.Optional[t.Any]:
69
try:
710
return func(*args, **kwargs)
8-
except Exception as ee: # pragma: no cover
9-
print(ee)
11+
except Exception as ex: # pragma: no cover
12+
logger.debug(
13+
f"Calling {func} with args: {args} kw: {kwargs} failed\nException: {ex}"
14+
)
1015
return None

0 commit comments

Comments
 (0)