branch: externals/scanner
commit 1495d30e3ba77025204aefd5144794cf4e65cc15
Author: Raffael Stocker <[email protected]>
Commit: Raffael Stocker <[email protected]>
add time stamps when logging and log program arguments
* scanner.el (scanner--log): add time stamp
(scanner-scan-document): log program arguments
(scanner-scan-image): log program arguments
---
scanner.el | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/scanner.el b/scanner.el
index 27568eb..9cd54c8 100644
--- a/scanner.el
+++ b/scanner.el
@@ -372,7 +372,8 @@ available options."
MSG is a format string, with ARGS passed to ‘format’."
(with-current-buffer (scanner--log-buffer)
(goto-char (point-max))
- (insert (apply #'format msg args) "\n")))
+ (insert (apply #'format (concat "[" (current-time-string) "]: " msg) args)
+ "\n")))
;; FIXME use special mode in the log buffer
(defun scanner--log-buffer ()
@@ -472,6 +473,7 @@ available, ask for a selection interactively."
switches
fmt)))
(push img-file file-list)
+ (scanner--log (format "scanimage arguments:
%s" scanimage-args))
(make-process :name "Scanner (scanimage)"
:command
`(,scanner-scanimage-program
,@scanimage-args)
@@ -503,7 +505,7 @@ available, ask for a selection interactively."
"\n")))
(let ((tesseract-args (scanner--tesseract-args
fl-file
doc-file)))
- (scanner--log "") ; make sure logs are
properly sequenced
+ (scanner--log (format "tesseract arguments:
%s" tesseract-args))
(make-process :name "Scanner (tesseract)"
:command
`(,scanner-tesseract-program
,@tesseract-args)
@@ -589,6 +591,8 @@ available, ask for a selection interactively."
img-file))))
nil
(scanner--log "Scanning image to file
\"%s\"" img-file)
+ (scanner--log (format "scanimage
arguments: %s"
+
scanimage-args))
(make-process :name "Scanner
(scanimage)"
:command
`(,scanner-scanimage-program
,@scanimage-args)