Skip to content

Commit

Permalink
Add debug logging for TWAIN calls
Browse files Browse the repository at this point in the history
  • Loading branch information
denisenkom committed Mar 9, 2024
1 parent 2ef202a commit 3dda4f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion demo/simple_tk.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@ def OnIdleTimer(self):
self.after(250, self.OnIdleTimer)


logging.basicConfig(level=logging.INFO)
logging.basicConfig(level=logging.DEBUG)
MainWindow(TITLE).mainloop()
2 changes: 2 additions & 0 deletions src/twain/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,9 @@ def _call(
buf: typing.Any,
expected_returns: tuple[int, ...] = (),
) -> int:
logger.debug("Calling TWAIN (%s,%d,%d,%d)", dest_id, dg, dat, msg)
rv = self._entry(self._app_id, dest_id, dg, dat, msg, buf)
logger.debug("TWAIN returned: %d", rv)
if rv == constants.TWRC_SUCCESS or rv in expected_returns:
return rv
if rv == constants.TWRC_FAILURE:
Expand Down

0 comments on commit 3dda4f1

Please sign in to comment.